mirror of
https://github.com/zadam/trilium.git
synced 2025-12-11 18:04:24 +01:00
feat(ckeditor/watchdog): add a toast to indicate the error
This commit is contained in:
parent
5ad267fe1b
commit
c600e8ef89
@ -987,7 +987,9 @@
|
||||
"placeholder": "Type the content of your code note here..."
|
||||
},
|
||||
"editable_text": {
|
||||
"placeholder": "Type the content of your note here..."
|
||||
"placeholder": "Type the content of your note here...",
|
||||
"editor_crashed_title": "The text editor crashed",
|
||||
"editor_crashed_content": "Your content was recovered successfully, but a few of your most recent changes may not have been saved."
|
||||
},
|
||||
"empty": {
|
||||
"open_note_instruction": "Open a note by typing the note's title into the input below or choose a note in the tree.",
|
||||
|
||||
@ -295,7 +295,15 @@ function useWatchdogCrashHandling() {
|
||||
hasCrashed.current = true;
|
||||
logError(`CKEditor crash logs: ${JSON.stringify(watchdog.crashes, null, 4)}`);
|
||||
|
||||
if (currentState === "crashedPermanently") {
|
||||
if (currentState === "crashed") {
|
||||
toast.showPersistent({
|
||||
id: "editor-crashed",
|
||||
icon: "bx bx-bug",
|
||||
title: t("editable_text.editor_crashed_title"),
|
||||
message: t("editable_text.editor_crashed_content"),
|
||||
timeout: 20_000
|
||||
})
|
||||
} else if (currentState === "crashedPermanently") {
|
||||
dialog.info(t("editable-text.keeps-crashing"));
|
||||
watchdog.editor?.enableReadOnlyMode("crashed-editor");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user