mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 11:26:15 +01:00
fix(editor): data loss if updating while editor crashed
This commit is contained in:
@@ -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> </p>), then just make it empty,
|
||||
|
||||
Reference in New Issue
Block a user