Skip to content

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

fix: refresh topics on notebook store refresh

thecodrrfb5b76477476
diff --git a/apps/web/src/stores/notebook-store.js b/apps/web/src/stores/notebook-store.js
index ce68edb6f..43410e83b 100644
--- a/apps/web/src/stores/notebook-store.js
+++ b/apps/web/src/stores/notebook-store.js
@@ -11,6 +11,7 @@ class NotebookStore extends BaseStore {
refresh = () => {
this.set((state) => (state.notebooks = db.notebooks.all));
+ this.setSelectedNotebook(this.get().selectedNotebookId);
};
delete = async (id) => {
@@ -29,6 +30,7 @@ class NotebookStore extends BaseStore {
};
setSelectedNotebook = (id) => {
+ if (!id) return;
this.set((state) => {
state.selectedNotebookTopics = db.notebooks.notebook(id).topics.all;
state.selectedNotebookId = id;