Skip to content

Commit

Permalink
fix: answer draft clear not right
Browse files Browse the repository at this point in the history
  • Loading branch information
shuashuai committed Feb 23, 2023
1 parent 6a4b887 commit d133587
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const Index: FC<Props> = ({ visible = false, data, callback }) => {
}, []);

useEffect(() => {
const draft = storageExpires.get(DRAFT_ANSWER_STORAGE_KEY);
const { content } = formData;

if (content.value) {
Expand All @@ -77,7 +78,7 @@ const Index: FC<Props> = ({ visible = false, data, callback }) => {
});

setHasDraft(true);
} else {
} else if (draft?.questionId === data.qid && !content.value) {
removeDraft();
}
}, [formData.content.value]);
Expand Down

0 comments on commit d133587

Please sign in to comment.