mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 19:12:27 +08:00
fix(electron): pasting non-existing file crashes the editor (closes #881)
This commit is contained in:
parent
a025645972
commit
5ee6ba8cb0
@ -12,6 +12,7 @@ import appContext from "../../components/app_context.js";
|
|||||||
import dialogService from "../../services/dialog.js";
|
import dialogService from "../../services/dialog.js";
|
||||||
import { initSyntaxHighlighting } from "./ckeditor/syntax_highlight.js";
|
import { initSyntaxHighlighting } from "./ckeditor/syntax_highlight.js";
|
||||||
import options from "../../services/options.js";
|
import options from "../../services/options.js";
|
||||||
|
import toast from "../../services/toast.js";
|
||||||
|
|
||||||
const ENABLE_INSPECTOR = false;
|
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);
|
await initSyntaxHighlighting(editor);
|
||||||
|
|
||||||
if (isClassicEditor) {
|
if (isClassicEditor) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user