From 8816a5e58d2524a7295b167eecff10a464e16589 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 6 Mar 2022 07:27:28 -0800 Subject: [PATCH] Add workaround on upate text when node has been deleted. --- packages/mindplot/src/components/MultilineTextEditor.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/mindplot/src/components/MultilineTextEditor.ts b/packages/mindplot/src/components/MultilineTextEditor.ts index 54ad16c1..8ac0564e 100644 --- a/packages/mindplot/src/components/MultilineTextEditor.ts +++ b/packages/mindplot/src/components/MultilineTextEditor.ts @@ -144,7 +144,13 @@ class MultilineTextEditor extends Events { const topicId = this._topic.getId(); const actionDispatcher = ActionDispatcher.getInstance(); - actionDispatcher.changeTextToTopic([topicId], text); + try { + actionDispatcher.changeTextToTopic([topicId], text); + } catch (e) { + // Hack: For some reasom, editor seems to end up connexted to a deleted node. + // More research required. + console.error(`Text could not be update -> ${JSON.stringify(e)}`); + } } }