Skip to content

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

fix: tags & color not initializing properly

thecodrr1828728f77eb
diff --git a/packages/core/api/index.js b/packages/core/api/index.js
index 69ec68c5a..000825a49 100644
--- a/packages/core/api/index.js
+++ b/packages/core/api/index.js
@@ -34,9 +34,9 @@ class Database {
/** @type {Trash} */
this.trash = await Trash.new(this);
/** @type {Content} */
- this.delta = await Content.new(this, false, "delta");
+ this.delta = await Content.new(this, "delta", false);
/** @type {Content} */
- this.text = await Content.new(this, false, "text");
+ this.text = await Content.new(this, "text", false);
}
sync() {
diff --git a/packages/core/collections/collection.js b/packages/core/collections/collection.js
index 8f90e9cfe..cf9bd4d01 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, cached = true, name = undefined) {
- const collection = new this(db, cached, name || this.name.toLowerCase());
+ static async new(db, name = undefined, cached = true) {
+ const collection = new this(db, name || this.name.toLowerCase(), cached);
await collection._collection.init();
if (collection.init) await collection.init();
return collection;
@@ -13,7 +13,7 @@ class Collection {
*
* @param {import("../api").default} db
*/
- constructor(db, cached, name) {
+ constructor(db, name, cached) {
this._db = db;
if (cached) this._collection = new CachedCollection(this._db.context, name);
else this._collection = new IndexedCollection(this._db.context, name);