mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 19:12:27 +08:00
fix(editor): data loss if updating while editor crashed
This commit is contained in:
parent
b379f89a7a
commit
d7f26fa27c
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user