diff --git a/.eslintignore b/.eslintignore
index 0342583ba..7b325e57a 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -15,6 +15,8 @@ apps/mobile/e2e/
# web
apps/web/public/an.js
+apps/web/src/common/sqlite/wa-sqlite-async.js
+apps/web/src/common/sqlite/wa-sqlite.js
# editor
packages/editor/styles/
diff --git a/apps/web/__e2e__/models/app.model.ts b/apps/web/__e2e__/models/app.model.ts
index b152e11fa..2e87849cf 100644
--- a/apps/web/__e2e__/models/app.model.ts
+++ b/apps/web/__e2e__/models/app.model.ts
@@ -81,7 +81,7 @@ export class AppModel {
async goToTags() {
await this.navigateTo("Tags");
- return new ItemsViewModel(this.page, "tags");
+ return new ItemsViewModel(this.page);
}
async goToColor(color: string) {
diff --git a/apps/web/src/common/attachments.ts b/apps/web/src/common/attachments.ts
index abae11871..939a8767e 100644
--- a/apps/web/src/common/attachments.ts
+++ b/apps/web/src/common/attachments.ts
@@ -18,19 +18,17 @@ along with this program. If not, see .
*/
import { lazify } from "../utils/lazify";
-import { Attachment } from "@notesnook/core";
import { db } from "./db";
async function download(hash: string, groupId?: string) {
- const attachment = db.attachments.attachment(hash);
+ const attachment = await db.attachments.attachment(hash);
if (!attachment) return;
const downloadResult = await db
.fs()
.downloadFile(
- groupId || attachment.metadata.hash,
- attachment.metadata.hash,
- attachment.chunkSize,
- attachment.metadata
+ groupId || attachment.hash,
+ attachment.hash,
+ attachment.chunkSize
);
if (!downloadResult) throw new Error("Failed to download file.");
@@ -46,7 +44,7 @@ export async function saveAttachment(hash: string) {
const { attachment, key } = response;
await lazify(import("../interfaces/fs"), ({ saveFile }) =>
- saveFile(attachment.metadata.hash, {
+ saveFile(attachment.hash, {
key,
iv: attachment.iv,
name: attachment.filename,
@@ -77,7 +75,7 @@ export async function downloadAttachment<
return (await db.attachments.read(hash, type)) as TOutputType;
const blob = await lazify(import("../interfaces/fs"), ({ decryptFile }) =>
- decryptFile(attachment.metadata.hash, {
+ decryptFile(attachment.hash, {
key,
iv: attachment.iv,
name: attachment.filename,
diff --git a/apps/web/src/common/dialog-controller.tsx b/apps/web/src/common/dialog-controller.tsx
index 417a9b37d..f7a988498 100644
--- a/apps/web/src/common/dialog-controller.tsx
+++ b/apps/web/src/common/dialog-controller.tsx
@@ -18,7 +18,6 @@ along with this program. If not, see .
*/
import { Dialogs } from "../dialogs";
-import { store as notebookStore } from "../stores/notebook-store";
import { store as tagStore } from "../stores/tag-store";
import { store as appStore } from "../stores/app-store";
import { store as editorStore } from "../stores/editor-store";
@@ -26,7 +25,6 @@ import { store as noteStore } from "../stores/note-store";
import { db } from "./db";
import { showToast } from "../utils/toast";
import { Text } from "@theme-ui/components";
-import { Topic as TopicIcon } from "../components/icons";
import Config from "../utils/config";
import { AppVersion, getChangelog } from "../utils/version";
import { Period } from "../dialogs/buy-dialog/types";
@@ -36,7 +34,7 @@ import { ConfirmDialogProps } from "../dialogs/confirm";
import { getFormattedDate } from "@notesnook/common";
import { downloadUpdate } from "../utils/updater";
import { ThemeMetadata } from "@notesnook/themes-server";
-import { Reminder } from "@notesnook/core";
+import { Color, Reminder, Tag } from "@notesnook/core";
import { AuthenticatorType } from "@notesnook/core/dist/api/user-manager";
import { createRoot } from "react-dom/client";
@@ -405,21 +403,25 @@ export function showPasswordDialog(
password?: string;
oldPassword?: string;
newPassword?: string;
+ deleteAllLockedNotes?: boolean;
}) => boolean | Promise
) {
const { title, subtitle, positiveButtonText, checks } = getDialogData(type);
- return showDialog("PasswordDialog", (Dialog, perform) => (
-