fix recursive state updates

This commit is contained in:
Ajay Bura 2023-10-19 10:27:33 +05:30
parent 613e6d6503
commit f6f2476d31

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);