Skip to content

Commit

Permalink
address linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
aswallace committed Feb 5, 2025
1 parent b58858e commit f2d49cc
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ interface AnnotationStatus {
*/
export default function NewAnnotationPathway(props: NewAnnotationProps) {
const dispatch = useDispatch();
// Destructure to prevent unnecessary useEffect triggers
const { onDismiss, hasUnsavedChanges } = props;

const [step, setStep] = React.useState<EditStep>(EditStep.CREATE_FIELD);
const [newValues, setNewValues] = React.useState<AnnotationValue | undefined>();
Expand Down Expand Up @@ -87,16 +89,16 @@ export default function NewAnnotationPathway(props: NewAnnotationProps) {
message: `Failed to create annotation: ${e}`,
});
} finally {
props?.hasUnsavedChanges(false);
props.onDismiss();
hasUnsavedChanges(false);
onDismiss();
}
}
default:
return;
}
};
checkForStatusUpdates();
}, [statuses, annotationCreationStatus, dispatch]);
}, [annotationCreationStatus, dispatch, hasUnsavedChanges, newFieldName, newValues, onDismiss]);

const addDropdownChip = (evt: React.FormEvent) => {
evt.preventDefault();
Expand Down

0 comments on commit f2d49cc

Please sign in to comment.