Skip to content

Commit

Permalink
Show previous annotations on later draft edits
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Stone committed Nov 7, 2022
1 parent 8b460e5 commit 5e49114
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/app/src/components/DrawTools/AnnotationMarkers.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@ import { AnnotationIcon } from '@heroicons/react/solid';

import { useDrawBoundary, useDrawPermissions } from '../DrawContext';

import { PANES } from '../../constants';
import { BOUNDARY_STATUS, PANES } from '../../constants';
import { DeleteAnnotationModal, ViewAnnotationModal } from './AnnotationModals';

export default function AnnotationMarkers() {
const annotations = useDrawBoundary().submission?.review?.annotations;
const boundary = useDrawBoundary();

const annotations =
boundary.status === BOUNDARY_STATUS.IN_REVIEW ||
boundary.status === BOUNDARY_STATUS.NEEDS_REVISIONS
? boundary.submission.review.annotations
: boundary.status === BOUNDARY_STATUS.DRAFT
? boundary?.previous_submission?.review.annotations
: null;

const [annotationToDelete, setAnnotationToDelete] = useState(null);
const [annotationToView, setAnnotationToView] = useState(null);
Expand Down

0 comments on commit 5e49114

Please sign in to comment.