mirror of
https://github.com/TriliumNext/Trilium.git
synced 2025-12-10 03:53:37 -06:00
feat(ckeditor/watchdog): add a more details button
This commit is contained in:
parent
522f3ae0a1
commit
f779108b6c
@ -989,7 +989,10 @@
|
||||
"editable_text": {
|
||||
"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."
|
||||
"editor_crashed_content": "Your content was recovered successfully, but a few of your most recent changes may not have been saved.",
|
||||
"editor_crashed_details_button": "View more details...",
|
||||
"editor_crashed_details_intro": "If you experience this error several times, consider reporting it on GitHub by pasting the information below.",
|
||||
"editor_crashed_details_title": "Technical information"
|
||||
},
|
||||
"empty": {
|
||||
"open_note_instruction": "Open a note by typing the note's title into the input below or choose a note in the tree.",
|
||||
|
||||
@ -293,7 +293,8 @@ function useWatchdogCrashHandling() {
|
||||
}
|
||||
|
||||
hasCrashed.current = true;
|
||||
logError(`CKEditor crash logs: ${JSON.stringify(watchdog.crashes, null, 4)}`);
|
||||
const formattedCrash = JSON.stringify(watchdog.crashes, null, 4);
|
||||
logError(`CKEditor crash logs: ${formattedCrash}`);
|
||||
|
||||
if (currentState === "crashed") {
|
||||
toast.showPersistent({
|
||||
@ -301,7 +302,20 @@ function useWatchdogCrashHandling() {
|
||||
icon: "bx bx-bug",
|
||||
title: t("editable_text.editor_crashed_title"),
|
||||
message: t("editable_text.editor_crashed_content"),
|
||||
timeout: 20_000
|
||||
buttons: [
|
||||
{
|
||||
text: t("editable_text.editor_crashed_details_button"),
|
||||
onClick: ({ dismissToast }) => {
|
||||
dismissToast();
|
||||
dialog.info(<>
|
||||
<p>{t("editable_text.editor_crashed_details_intro")}</p>
|
||||
<h3>{t("editable_text.editor_crashed_details_title")}</h3>
|
||||
<pre>{formattedCrash}</pre>
|
||||
</>);
|
||||
}
|
||||
}
|
||||
]
|
||||
// timeout: 20_000
|
||||
})
|
||||
} else if (currentState === "crashedPermanently") {
|
||||
dialog.info(t("editable-text.keeps-crashing"));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user