From d8f0709bce891a8ebc0676bb3b6b5314bf78a129 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 8 Jun 2025 21:35:01 +0300 Subject: [PATCH] fix(editor): white screen if CKEditor crashes a second time --- apps/client/src/widgets/type_widgets/editable_text.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/client/src/widgets/type_widgets/editable_text.ts b/apps/client/src/widgets/type_widgets/editable_text.ts index 005ac1ad4..2c62eb08e 100644 --- a/apps/client/src/widgets/type_widgets/editable_text.ts +++ b/apps/client/src/widgets/type_widgets/editable_text.ts @@ -166,7 +166,7 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget { // is shorter than minimumNonErrorTimePeriod, the watchdog changes // its state to crashedPermanently, and it stops restarting the editor. // This prevents an infinite restart loop. - crashNumberLimit: 3, + crashNumberLimit: 10, // A minimum number of milliseconds between saving the editor data internally (defaults to 5000). // Note that for large documents, this might impact the editor performance. saveInterval: 5000 @@ -190,7 +190,7 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget { } }); - this.watchdog.setCreator(async (elementOrData, editorConfig) => { + this.watchdog.setCreator(async (_, editorConfig) => { logInfo("Creating new CKEditor"); const finalConfig = { @@ -220,7 +220,7 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget { } //@ts-ignore - const editor = await editorClass.create(elementOrData, finalConfig); + const editor = await editorClass.create(this.$editor[0], finalConfig); const notificationsPlugin = editor.plugins.get("Notification"); notificationsPlugin.on("show:warning", (evt, data) => {