fix(rtl): wrong content when switching to an empty note

This commit is contained in:
Elian Doran 2025-03-05 23:06:18 +02:00
parent 77d6cdc546
commit a3a34cfab0
No known key found for this signature in database

View File

@ -492,21 +492,19 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
this.refreshIncludedNote(this.$editor, noteId); this.refreshIncludedNote(this.$editor, noteId);
} }
async reinitialize(data = null) { async reinitialize(data) {
if (!this.watchdog) { if (!this.watchdog) {
return; return;
} }
if (!data) {
data = this.watchdog.editor.getData();
}
this.watchdog.destroy(); this.watchdog.destroy();
await this.createEditor(); await this.createEditor();
this.watchdog.editor.setData(data); this.watchdog.editor.setData(data);
} }
async onLanguageChanged() { async onLanguageChanged() {
await this.reinitialize(); const data = this.watchdog.editor.getData();
await this.reinitialize(data);
} }
} }