fix: init notes before cleaning up notebooks

This commit is contained in:
thecodrr
2021-08-16 11:08:40 +05:00
parent 48e682eb2c
commit 9f0ae2e76f
2 changed files with 3 additions and 2 deletions

View File

@@ -131,7 +131,8 @@ export default class Notebooks extends Collection {
} }
} }
cleanup() { async cleanup() {
await this._db.notes.init();
for (let notebook of this.all) { for (let notebook of this.all) {
for (let topic of notebook.topics) { for (let topic of notebook.topics) {
const clonedIds = topic.notes.slice(); const clonedIds = topic.notes.slice();

View File

@@ -142,7 +142,7 @@ export default class Backup {
]; ];
if (await this._migrator.migrate(collections, (id) => data[id], version)) { if (await this._migrator.migrate(collections, (id) => data[id], version)) {
this._db.notebooks.cleanup(); await this._db.notebooks.cleanup();
} }
} }