From 0aeade69da20fbc9fc8a28cbcc4aa07bd21692d3 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Thu, 23 Mar 2023 13:12:43 +0500 Subject: [PATCH] web: fix topic search --- apps/web/src/views/search.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/web/src/views/search.js b/apps/web/src/views/search.js index 5f495fa18..94e606b93 100644 --- a/apps/web/src/views/search.js +++ b/apps/web/src/views/search.js @@ -40,9 +40,9 @@ async function typeToItems(type, context) { case "notebooks": return ["notebooks", db.notebooks.all]; case "topics": { - const notebookId = notebookstore.get().selectedNotebookId; - if (!notebookId) return ["topics", []]; - const topics = db.notebooks.notebook(notebookId).topics.all; + const selectedNotebook = notebookstore.get().selectedNotebook; + if (!selectedNotebook) return ["topics", []]; + const topics = db.notebooks.notebook(selectedNotebook.id).topics.all; return ["topics", topics]; } case "tags": @@ -114,9 +114,9 @@ function Search({ type }) { case "notebooks": return "all notebooks"; case "topics": { - const notebookId = notebookstore.get().selectedNotebookId; - if (!notebookId) return ""; - const notebook = db.notebooks.notebook(notebookId); + const selectedNotebook = notebookstore.get().selectedNotebook; + if (!selectedNotebook) return ""; + const notebook = db.notebooks.notebook(selectedNotebook.id); return `topics in ${notebook.title} notebook`; } case "tags":