Skip to content

Commit

Permalink
fix: save test alert modal (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdmelKun authored Dec 7, 2023
1 parent 9e8ec43 commit 1b54b87
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/expo/src/forms/CreateTestForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ const CreateTestForm: FC<Props> = ({
message: errors.description.message,
});
}
setOpenAlert(false);
}
}, [errors]);

Expand Down Expand Up @@ -789,15 +790,16 @@ const CreateTestForm: FC<Props> = ({

<AlertModal
isVisible={openAlert}
alertTitle={"Save your test?"}
alertTitle={"Save your changes?"}
alertDescription={
"You will lose all unsaved changes if you exit this screen"
}
confirmButtonText={"Yes"}
isCancelButtonVisible={true}
cancelButtonText={"Cancel"}
cancelButtonText={"Exit"}
onCancel={() => {
setOpenAlert(false);
goBack();
}}
isLoading={isCreatingQuiz}
onConfirm={handleSubmit(submitForm)}
Expand Down

0 comments on commit 1b54b87

Please sign in to comment.