Skip to content

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

web: use checkFeature in multi-select

Abdullah Atta74de09e44188
diff --git a/apps/web/src/common/multi-select.ts b/apps/web/src/common/multi-select.ts
index f816aa34a..581d9afce 100644
--- a/apps/web/src/common/multi-select.ts
+++ b/apps/web/src/common/multi-select.ts
@@ -34,8 +34,7 @@ import {
showMultiPermanentDeleteConfirmation
} from "../dialogs/confirm";
import { strings } from "@notesnook/intl";
-import { isFeatureAvailable } from "@notesnook/common";
-import { showFeatureNotAllowedToast } from "./toasts";
+import { checkFeature } from ".";
async function moveNotesToTrash(ids: string[], confirm = true) {
if (confirm && !(await showMultiDeleteConfirmation(ids.length))) return;
@@ -186,11 +185,13 @@ async function restoreItemsFromTrash(ids: string[]) {
if (!ids.length) return;
const notebookIds = ids.filter((id) => db.trash.cache.notebooks.includes(id));
- const result = await isFeatureAvailable(
- "notebooks",
- (await db.notebooks.all.count()) + notebookIds.length
- );
- if (!result.isAllowed) return showFeatureNotAllowedToast(result);
+ if (
+ !(await checkFeature(
+ "notebooks",
+ (await db.notebooks.all.count()) + notebookIds.length
+ ))
+ )
+ return;
await TaskManager.startTask({
type: "status",