Skip to content

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

api: add default General topic in notebook

thecodrr35e205394311
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] = [];
}
}