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: do not return undefined items in db.settings.pins
thecodrr49ad9650eab3
diff --git a/packages/core/api/settings.js b/packages/core/api/settings.jsindex 4b7f3acf9..7ceb3e1b0 100644--- a/packages/core/api/settings.js+++ b/packages/core/api/settings.js@@ -67,17 +67,18 @@ class Settings {get pins() {return this._settings.pins.reduce((prev, pin) => {+ let item;if (pin.type === "notebook") {- prev.push(this._db.notebooks.notebook(pin.data.id).data);+ item = this._db.notebooks.notebook(pin.data.id).data;} else if (pin.type === "topic") {- prev.push(- this._db.notebooks- .notebook(pin.data.notebookId)- .topics.topic(pin.data.id)._topic- );+ item = this._db.notebooks+ .notebook(pin.data.notebookId)+ .topics.topic(pin.data.id)._topic;} else if (pin.type === "tag") {- prev.push(this._db.tags.tag(pin.data.id));+ item =+ this._db.tags.tag(pin.data.id) || this._db.tags.tag(pin.data.title);}+ if (item) prev.push(item);return prev;}, []);}diff --git a/packages/core/collections/tags.js b/packages/core/collections/tags.jsindex 69f1c952e..ebaecb22f 100644--- a/packages/core/collections/tags.js+++ b/packages/core/collections/tags.js@@ -5,8 +5,7 @@ import set from "../utils/set";export default class Tags extends Collection {tag(id) {- const tagItem = this.all.find((t) => t.id === id);- if (!tagItem) return;+ const tagItem = this.all.find((t) => t.id === id || t.title === id);return tagItem;}