Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: collection saved with wrong keys in prod

thecodrr912381ac0c33
diff --git a/packages/core/api/index.js b/packages/core/api/index.js
index bbd72fa70..7045059f7 100644
--- a/packages/core/api/index.js
+++ b/packages/core/api/index.js
@@ -26,15 +26,15 @@ class Database {
// collections
/** @type {Notes} */
- this.notes = await Notes.new(this);
+ this.notes = await Notes.new(this, "notes");
/** @type {Notebooks} */
- this.notebooks = await Notebooks.new(this);
+ this.notebooks = await Notebooks.new(this, "notebooks");
/** @type {Tags} */
this.tags = await Tags.new(this, "tags");
/** @type {Tags} */
this.colors = await Tags.new(this, "colors");
/** @type {Trash} */
- this.trash = await Trash.new(this);
+ this.trash = await Trash.new(this, "trash");
/** @type {Content} */
this.delta = await Content.new(this, "delta", false);
/** @type {Content} */
diff --git a/packages/core/collections/collection.js b/packages/core/collections/collection.js
index aba4b92ec..63ea03412 100644
--- a/packages/core/collections/collection.js
+++ b/packages/core/collections/collection.js
@@ -2,8 +2,8 @@ import CachedCollection from "../database/cached-collection";
import IndexedCollection from "../database/indexed-collection";
class Collection {
- static async new(db, name = undefined, cached = true) {
- const collection = new this(db, name || this.name.toLowerCase(), cached);
+ static async new(db, name, cached = true) {
+ const collection = new this(db, name, cached);
await collection._collection.init();
if (collection.init) await collection.init();