mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: fix monaco paste event
This commit is contained in:
1 file changed
+3
-1
@@ -85,6 +85,8 @@ function handlePasteEvent(editor: monaco.editor.IStandaloneCodeEditor) {
|
|||||||
ext = 'zip';
|
ext = 'zip';
|
||||||
}
|
}
|
||||||
if (!ext) return;
|
if (!ext) return;
|
||||||
|
ev.preventDefault();
|
||||||
|
ev.stopPropagation();
|
||||||
const filename = `${nanoid()}.${ext}`;
|
const filename = `${nanoid()}.${ext}`;
|
||||||
const data = new FormData();
|
const data = new FormData();
|
||||||
data.append('filename', filename);
|
data.append('filename', filename);
|
||||||
@@ -129,7 +131,7 @@ function handlePasteEvent(editor: monaco.editor.IStandaloneCodeEditor) {
|
|||||||
console.error(e);
|
console.error(e);
|
||||||
updateText(`${i18n('Upload Failed')}: ${e.message}`);
|
updateText(`${i18n('Upload Failed')}: ${e.message}`);
|
||||||
});
|
});
|
||||||
});
|
}, { capture: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
export function registerAction(
|
export function registerAction(
|
||||||
|
|||||||
Reference in new issue
Block a user