mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
api: add default General topic in notebook
This commit is contained in:
@@ -105,9 +105,10 @@ class Database {
|
|||||||
async addNotebook(notebook) {
|
async addNotebook(notebook) {
|
||||||
if (!notebook || !notebook.title) return;
|
if (!notebook || !notebook.title) return;
|
||||||
const id = notebook.dateCreated || Date.now();
|
const id = notebook.dateCreated || Date.now();
|
||||||
let topics = {};
|
let topics = { General: [] };
|
||||||
if (notebook.topics) {
|
if (notebook.topics) {
|
||||||
for (let topic of notebook.topics) {
|
for (let topic of notebook.topics) {
|
||||||
|
if (!topic) continue;
|
||||||
topics[topic] = [];
|
topics[topic] = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user