Skip to content

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

core: remove usage of db.features

Abdullah Atta872f4d7e9118
diff --git a/packages/core/src/collections/colors.ts b/packages/core/src/collections/colors.ts
index 31b00b5f7..881f7e204 100644
--- a/packages/core/src/collections/colors.ts
+++ b/packages/core/src/collections/colors.ts
@@ -84,7 +84,6 @@ export class Colors implements ICollection {
await this.collection.update([oldColor.id], item);
return oldColor.id;
}
- if (!this.db.features.allowed("colors")) return;
const id = item.id || getId(item.dateCreated);
await this.collection.upsert({
diff --git a/packages/core/src/collections/notebooks.ts b/packages/core/src/collections/notebooks.ts
index 14f9864bf..7ad7b3ace 100644
--- a/packages/core/src/collections/notebooks.ts
+++ b/packages/core/src/collections/notebooks.ts
@@ -59,8 +59,6 @@ export class Notebooks implements ICollection {
if (oldNotebook && isTrashItem(oldNotebook))
throw new Error("Cannot modify trashed notebooks.");
- if (!oldNotebook && !(await this.db.features.allowed("notebooks"))) return;
-
const mergedNotebook: Partial<Notebook> = {
...oldNotebook,
...notebookArg
diff --git a/packages/core/src/collections/tags.ts b/packages/core/src/collections/tags.ts
index e14752e9c..3e06bb072 100644
--- a/packages/core/src/collections/tags.ts
+++ b/packages/core/src/collections/tags.ts
@@ -64,7 +64,6 @@ export class Tags implements ICollection {
await this.collection.update([oldTag.id], item);
return oldTag.id;
}
- if (!(await this.db.features.allowed("tags"))) return;
const id = item.id || getId();
await this.collection.upsert({
diff --git a/packages/core/src/collections/trash.ts b/packages/core/src/collections/trash.ts
index b4c4e6777..4478f1ea0 100644
--- a/packages/core/src/collections/trash.ts
+++ b/packages/core/src/collections/trash.ts
@@ -197,11 +197,6 @@ export default class Trash {
}
if (notebookIds.length > 0) {
- const expectedCount =
- (await this.db.notebooks.all.count()) + notebookIds.length;
- if (!(await this.db.features.allowed("notebooks", expectedCount)))
- return false;
-
const ids = [...notebookIds, ...(await this.subNotebooks(notebookIds))];
await this.db.notebooks.collection.update(ids, {
type: "notebook",