From 35e205394311ff236559ef201f9c3cbb4a5b5fab Mon Sep 17 00:00:00 2001 From: thecodrr Date: Thu, 5 Dec 2019 17:45:45 +0500 Subject: [PATCH] api: add default General topic in notebook --- packages/core/api/database.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/core/api/database.js b/packages/core/api/database.js index 8b7ebd63f..5fa9cb1f6 100644 --- a/packages/core/api/database.js +++ b/packages/core/api/database.js @@ -105,9 +105,10 @@ class Database { async addNotebook(notebook) { if (!notebook || !notebook.title) return; const id = notebook.dateCreated || Date.now(); - let topics = {}; + let topics = { General: [] }; if (notebook.topics) { for (let topic of notebook.topics) { + if (!topic) continue; topics[topic] = []; } }