From a3a34cfab0e8a0016232cae39c1adf00d4c8c750 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 5 Mar 2025 23:06:18 +0200 Subject: [PATCH] fix(rtl): wrong content when switching to an empty note --- src/public/app/widgets/type_widgets/editable_text.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/public/app/widgets/type_widgets/editable_text.js b/src/public/app/widgets/type_widgets/editable_text.js index 44ea52e92..9ac5f1b56 100644 --- a/src/public/app/widgets/type_widgets/editable_text.js +++ b/src/public/app/widgets/type_widgets/editable_text.js @@ -492,21 +492,19 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget { this.refreshIncludedNote(this.$editor, noteId); } - async reinitialize(data = null) { + async reinitialize(data) { if (!this.watchdog) { return; } - if (!data) { - data = this.watchdog.editor.getData(); - } this.watchdog.destroy(); await this.createEditor(); this.watchdog.editor.setData(data); } async onLanguageChanged() { - await this.reinitialize(); + const data = this.watchdog.editor.getData(); + await this.reinitialize(data); } }