fix: overlapping note contents when quickly switching

(fixes streetwriters/notesnook#561)
This commit is contained in:
thecodrr
2022-05-10 13:57:01 +05:00
parent 84a3095b35
commit eb16282f15
2 changed files with 3 additions and 1 deletions

View File

@@ -278,7 +278,7 @@ function Editor({ noteId, nonce }) {
sessionId={sessionId}
onChange={(content, editor) => {
const { id, sessionId } = editorstore.get().session;
debouncedOnEditorChange(sessionId, id, sessionId, content);
debouncedOnEditorChange(id, id, sessionId, content);
debouncedUpdateWordCount(editor);
}}
changeInterval={100}

View File

@@ -174,6 +174,8 @@ class EditorStore extends BaseStore {
}
this.set((state) => {
if (state.session.id !== note.id) return;
for (let key in session) {
if (key === "content") continue;
state.session[key] = session[key];