fix recursive state updates (#1458)
authorAjay Bura <32841439+ajbura@users.noreply.github.com>
Thu, 19 Oct 2023 06:43:37 +0000 (17:43 +1100)
committerGitHub <noreply@github.com>
Thu, 19 Oct 2023 06:43:37 +0000 (17:43 +1100)
src/app/organisms/room/RoomInput.tsx

index ae12afb05f3c2c09df7eece0d53ddba7574668e2..a1fa6c26836ae88f72d3be4969277f175e481a50 100644 (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);