Skip to content

Build your personal knowledge base with Trilium Notes

fix(dev): crash the text editor where the error reporter can see it

Elian Doranc36ea58460df
diff --git a/apps/client/src/widgets/layout/NoteActions.tsx b/apps/client/src/widgets/layout/NoteActions.tsx
index 88dc664622..a4be5f0e16 100644
--- a/apps/client/src/widgets/layout/NoteActions.tsx
+++ b/apps/client/src/widgets/layout/NoteActions.tsx
@@ -335,11 +335,10 @@ function DevelopmentActions({ note, noteContext }: { note: FNote, noteContext?:
<FormListItem
icon="bx bx-error"
disabled={note.type !== "text"}
- onClick={() => {
- noteContext?.getTextEditor(editor => {
- editor.editing.view.change(() => {
- throw new Error("Editor crashed.");
- });
+ onClick={async () => {
+ const editor = await noteContext?.getTextEditor();
+ editor?.editing.view.change(() => {
+ throw new Error("Editor crashed.");
});
}}>Crash editor</FormListItem>
</>