Skip to content

Commit

Permalink
Fix error being displayed in patient visit even if nothing has been s…
Browse files Browse the repository at this point in the history
…ubmitted
  • Loading branch information
SilverD3 committed Sep 21, 2023
1 parent 3f02640 commit 24f7813
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ const EditPatientActivity: FunctionComponent<TProps> = ({
const { id } = useParams<{ id: string }>();
const { t } = useTranslation();

// Reset patient update state to avoid error displaying
// in patient details activity.
// See issue [OHCS-107](https://openhospital.atlassian.net/browse/OHCS-107)
useEffect(() => {
return () => {
updatePatientReset();
};
}, []);

useEffect(() => {
if (isEmpty(patient.data) && patient.status === "IDLE" && id) {
getPatientThunk(id);
Expand Down

0 comments on commit 24f7813

Please sign in to comment.