From 19bc8b765dc1267f759045d535b5dfcacfd0b644 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Sat, 2 Mar 2024 20:07:54 +0500 Subject: [PATCH] web: fix attachFile- when saving web clip --- apps/web/src/utils/web-extension-server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/utils/web-extension-server.ts b/apps/web/src/utils/web-extension-server.ts index 10792c208..864614800 100644 --- a/apps/web/src/utils/web-extension-server.ts +++ b/apps/web/src/utils/web-extension-server.ts @@ -28,10 +28,10 @@ import { isUserPremium } from "../hooks/use-is-user-premium"; import { store as appstore } from "../stores/app-store"; import { h } from "./html"; import { sanitizeFilename } from "@notesnook/common"; -import { attachFile } from "../components/editor/picker"; import { getFormattedDate } from "@notesnook/common"; import { useStore as useThemeStore } from "../stores/theme-store"; import { isCipher } from "@notesnook/core/dist/database/crypto"; +import { attachFiles } from "../components/editor/picker"; export class WebExtensionServer implements Server { async login() { @@ -85,7 +85,7 @@ export class WebExtensionServer implements Server { } ); - const attachment = await attachFile(clippedFile); + const attachment = (await attachFiles([clippedFile]))?.at(0); if (!attachment) return; clipContent += h("iframe", [], {