Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: handle case where note is switched very fast

thecodrre13077133015
diff --git a/apps/web/src/components/editor/index.js b/apps/web/src/components/editor/index.js
index 4592d08eb..971137f3a 100644
--- a/apps/web/src/components/editor/index.js
+++ b/apps/web/src/components/editor/index.js
@@ -63,6 +63,7 @@ function Editor({ noteId, nonce }) {
} = editorstore.get().session;
const editor = editorRef.current?.editor;
if (!editor) return;
+ clearTimeout(editor.changeTimeout);
async function setContents() {
// NOTE: workaround to not fire onEditorChange event on content load
editor.isLoading = true;
@@ -158,7 +159,7 @@ function Editor({ noteId, nonce }) {
};
});
}}
- changeInterval={500}
+ changeInterval={100}
onWordCountChanged={updateWordCount}
onInit={async () => {
await startSession(noteId);