From 90a3bd3307aa0458ccb7e00e948c5e29ea7870c3 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Thu, 23 Mar 2023 13:12:35 +0500 Subject: [PATCH] web: fix crash on creating a topic --- apps/web/src/common/dialog-controller.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/src/common/dialog-controller.tsx b/apps/web/src/common/dialog-controller.tsx index 9269ad5f3..ea2909958 100644 --- a/apps/web/src/common/dialog-controller.tsx +++ b/apps/web/src/common/dialog-controller.tsx @@ -471,9 +471,9 @@ export function showCreateTopicDialog() { }} onAction={async (topic: Record) => { if (!topic) return; - const notebookId = notebookStore.get().selectedNotebookId; - await db.notebooks?.notebook(notebookId).topics.add(topic); - notebookStore.setSelectedNotebook(notebookId); + const notebook = notebookStore.get().selectedNotebook; + await db.notebooks?.notebook(notebook.id).topics.add(topic); + notebookStore.setSelectedNotebook(notebook.id); showToast("success", "Topic created!"); perform(true); }}