Skip to content

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

fix: prevent quill from an extra re-render

thecodrrc44c5ea2d05b
diff --git a/apps/web/src/stores/editor-store.js b/apps/web/src/stores/editor-store.js
index f847cf07b..0cc1a00ae 100644
--- a/apps/web/src/stores/editor-store.js
+++ b/apps/web/src/stores/editor-store.js
@@ -134,12 +134,18 @@ class EditorStore extends BaseStore {
setSession = (set, immediate = false) => {
clearTimeout(this.get().session.timeout);
const oldSession = { ...this.get().session };
+
+ // TODO test this
+ this.set((state) => {
+ if (state.session.state !== SESSION_STATES.stale)
+ state.session.state = SESSION_STATES.stale;
+ });
+
this.set((state) => {
set(state);
state.session.timeout = setTimeout(
() => {
- this.set((state) => (state.session.state = SESSION_STATES.stale));
this.session = this.get().session;
this.saveSession(oldSession);
},