fix recursive state updates (#1458)

This commit is contained in:
Ajay Bura 2023-10-19 17:43:37 +11:00 committed by GitHub
parent 50429a3513
commit ed3d14b131
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -187,7 +187,7 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
const parsedDraft = JSON.parse(JSON.stringify(editor.children));
setMsgDraft(parsedDraft);
} else {
roomIdToMsgDraftAtomFamily.remove(roomId);
setMsgDraft([]);
}
resetEditor(editor);
resetEditorHistory(editor);