mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
fix: init notes before cleaning up notebooks
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user