mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-18 09:36:08 +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';
|
||||
}
|
||||
if (!ext) return;
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
const filename = `${nanoid()}.${ext}`;
|
||||
const data = new FormData();
|
||||
data.append('filename', filename);
|
||||
@@ -129,7 +131,7 @@ function handlePasteEvent(editor: monaco.editor.IStandaloneCodeEditor) {
|
||||
console.error(e);
|
||||
updateText(`${i18n('Upload Failed')}: ${e.message}`);
|
||||
});
|
||||
});
|
||||
}, { capture: true });
|
||||
}
|
||||
|
||||
export function registerAction(
|
||||
|
||||
Reference in new issue
Block a user