From 7d4a7d4ab6dd67063095f765b8f7c2473ff1e092 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Thu, 4 Dec 2025 22:15:13 +0200 Subject: [PATCH] feat(dev): option to crash CKEditor --- apps/client/src/widgets/ribbon/NoteActions.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/client/src/widgets/ribbon/NoteActions.tsx b/apps/client/src/widgets/ribbon/NoteActions.tsx index 863867b7a..f1af3b20b 100644 --- a/apps/client/src/widgets/ribbon/NoteActions.tsx +++ b/apps/client/src/widgets/ribbon/NoteActions.tsx @@ -107,12 +107,12 @@ function NoteContextMenu({ note, noteContext }: { note: FNote, noteContext?: Not - {glob.isDev && } + {glob.isDev && } ); } -function DevelopmentActions({ note }: { note: FNote }) { +function DevelopmentActions({ note, noteContext }: { note: FNote, noteContext?: NoteContext }) { return ( <> @@ -120,6 +120,16 @@ function DevelopmentActions({ note }: { note: FNote }) { icon="bx bx-printer" onClick={() => window.open(`/?print=#root/${note.noteId}`, "_blank")} >Open print page + {note.type === "text" && ( + { + noteContext?.getTextEditor(editor => { + editor.editing.view.change(() => { + throw new Error("Editor crashed."); + }); + }); + }}>Crash editor)} ) }