Merge pull request #216 from answerdev/feat/1.0.6/ui

fix: answer draft clear not right
This commit is contained in:
dashuai
2023-02-23 17:05:36 +08:00
committed by GitHub
@@ -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) {
@@ -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]);