Skip to content

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

fix: undefined notes context causing crash

thecodrrc5705cdd9512
diff --git a/apps/web/src/stores/note-store.js b/apps/web/src/stores/note-store.js
index 362dc4204..941bd4a57 100644
--- a/apps/web/src/stores/note-store.js
+++ b/apps/web/src/stores/note-store.js
@@ -18,13 +18,14 @@ class NoteStore extends BaseStore {
};
refresh = () => {
- if (this.get().context) this.refreshContext();
- else this.set((state) => (state.notes = db.notes.group(undefined, true)));
+ this.refreshContext();
+ this.set((state) => (state.notes = db.notes.group(undefined, true)));
};
refreshContext = () => {
- if (!this.get().context) return;
- this.setContext(this.context);
+ const context = this.get().context;
+ if (!context) return;
+ this.setContext(context);
};
setContext = (context) => {