fix(electron): pasting non-existing file crashes the editor (closes #881)

This commit is contained in:
Elian Doran 2025-01-04 16:56:26 +02:00
parent a025645972
commit 5ee6ba8cb0
No known key found for this signature in database

View File

@ -12,6 +12,7 @@ import appContext from "../../components/app_context.js";
import dialogService from "../../services/dialog.js";
import { initSyntaxHighlighting } from "./ckeditor/syntax_highlight.js";
import options from "../../services/options.js";
import toast from "../../services/toast.js";
const ENABLE_INSPECTOR = false;
@ -194,6 +195,12 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
}
});
const notificationsPlugin = editor.plugins.get("Notification");
notificationsPlugin.on("show:warning", (evt, data) => {
toast.showErrorTitleAndMessage(data.title, data.message.message);
evt.stop();
});
await initSyntaxHighlighting(editor);
if (isClassicEditor) {