Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/14136

Vanessaa9b17850efab
diff --git a/app/src/protyle/util/compatibility.ts b/app/src/protyle/util/compatibility.ts
index b2265da451..eb19272496 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 9fd49f86cf..19c825a103 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");