fix: repair notebook references in notes on sync

This commit is contained in:
thecodrr
2021-11-12 10:32:25 +05:00
parent b139623420
commit e608eaaedf
6 changed files with 44 additions and 16 deletions

View File

@@ -37,7 +37,11 @@ export default class Topic {
array.push(notebook);
} else {
const topicIndex = array[notebookIndex].topics.indexOf(topic.id);
if (topicIndex > -1) return;
if (topicIndex > -1) {
if (!this.has(noteId)) topic.notes.push(noteId);
continue;
}
array[notebookIndex].topics.push(topic.id);
}