fix(editor): data loss if updating while editor crashed

This commit is contained in:
Elian Doran 2025-06-08 20:39:31 +03:00
parent b379f89a7a
commit d7f26fa27c
No known key found for this signature in database

View File

@ -336,6 +336,11 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
}
getData() {
if (!this.watchdog.editor) {
// There is nothing to save, most likely a result of the editor crashing and reinitializing.
return;
}
const content = this.watchdog.editor?.getData() ?? "";
// if content is only tags/whitespace (typically <p>&nbsp;</p>), then just make it empty,