A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
fix: no tag with title x found error on sync
thecodrr25ee202d6495
diff --git a/packages/core/collections/notes.js b/packages/core/collections/notes.jsindex 8d8973066..d2f63b677 100644--- a/packages/core/collections/notes.js+++ b/packages/core/collections/notes.js@@ -25,10 +25,10 @@ export default class Notes extends Collection {if (noteArg.remote || noteArg.migrated) {if (oldNote) {- if (oldNote.color !== noteArg.color) {+ if (!!oldNote.color && oldNote.color !== noteArg.color) {await this._db.colors.remove(oldNote.color, id);}- if (oldNote.tags) {+ if (!!oldNote.tags) {for (let tag of oldNote.tags) {await this._db.tags.remove(tag, id);}diff --git a/packages/core/collections/tags.js b/packages/core/collections/tags.jsindex ebaecb22f..5c49c443c 100644--- a/packages/core/collections/tags.js+++ b/packages/core/collections/tags.js@@ -46,7 +46,7 @@ export default class Tags extends Collection {async remove(tagTitle, noteId) {if (!tagTitle || !noteId) new Error("tagTitle and noteId cannot be falsy.");- let tag = this.all.find((t) => t.title === tagTitle);+ let tag = this.all.find((t) => t.title === tagTitle || t.id === tagTitle);if (!tag) throw new Error(`No tag with title "${tagTitle}" found.`);tag = qclone(tag);const noteIndex = tag.noteIds.indexOf(noteId);