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: locked note is favorited
thecodrr0a844b55c09f
diff --git a/packages/core/__tests__/vault.test.js b/packages/core/__tests__/vault.test.jsindex edfd51902..f6e3f30e6 100644--- a/packages/core/__tests__/vault.test.js+++ b/packages/core/__tests__/vault.test.js@@ -54,6 +54,15 @@ test("lock a note", () =>expect(content.data.cipher).toBeDefined();}));+test("locked note is not favorited", () =>+ noteTest().then(async ({ db, id }) => {+ await db.vault.create("password");+ await db.vault.add(id);+ const note = db.notes.note(id);++ expect(note.data.favorite).toBeFalsy();+ }));+test("unlock a note", () =>noteTest().then(async ({ db, id }) => {await db.vault.create("password");diff --git a/packages/core/api/vault.js b/packages/core/api/vault.jsindex 51885a32c..797870033 100644--- a/packages/core/api/vault.js+++ b/packages/core/api/vault.js@@ -184,9 +184,9 @@ export default class Vault {let { id, content: { type, data } = {}, contentId } = note;if (!data || !type || !contentId) {- note = this._db.notes.note(id);- if (note.data.locked) return;- contentId = note.data.contentId;+ note = this._db.notes.note(id).data;+ if (note.locked) return;+ contentId = note.contentId;let content = await this._db.content.raw(contentId);data = content.data;type = content.type;