diff --git a/app/src/protyle/util/compatibility.ts b/app/src/protyle/util/compatibility.ts index b2265da45..eb1927249 100644 --- a/app/src/protyle/util/compatibility.ts +++ b/app/src/protyle/util/compatibility.ts @@ -43,7 +43,7 @@ export const readClipboard = async () => { const text: { textHTML?: string, textPlain?: string, - files?: File, + files?: File[], } = {textPlain: "", textHTML: ""}; if (isInAndroid()) { text.textPlain = window.JSAndroid.readClipboard(); @@ -62,7 +62,7 @@ export const readClipboard = async () => { } if (item.types.includes("image/png")) { const blob = await item.getType("image/png"); - text.files = new File([blob], "image.png", {type: "image/png", lastModified: Date.now()}); + text.files = [new File([blob], "image.png", {type: "image/png", lastModified: Date.now()})]; } } return text; diff --git a/app/src/protyle/util/paste.ts b/app/src/protyle/util/paste.ts index 9fd49f86c..19c825a10 100644 --- a/app/src/protyle/util/paste.ts +++ b/app/src/protyle/util/paste.ts @@ -255,7 +255,7 @@ const readLocalFile = async (protyle: IProtyle, localFiles: string[]) => { export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEvent | { textHTML?: string, textPlain?: string, - files?: FileList, + files?: File[], }) & { target: HTMLElement }) => { @@ -266,7 +266,7 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven let textHTML: string; let textPlain: string; let siyuanHTML: string; - let files: FileList | DataTransferItemList; + let files: FileList | DataTransferItemList | File[]; if ("clipboardData" in event) { textHTML = event.clipboardData.getData("text/html"); textPlain = event.clipboardData.getData("text/plain");