mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 04:00:59 +01:00
web: fix crash on creating a topic
This commit is contained in:
committed by
Abdullah Atta
parent
dd9c555bff
commit
90a3bd3307
@@ -471,9 +471,9 @@ export function showCreateTopicDialog() {
|
||||
}}
|
||||
onAction={async (topic: Record<string, unknown>) => {
|
||||
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);
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user