mirror of
https://github.com/zadam/trilium.git
synced 2025-10-07 22:22:44 +08:00
fix(editor): data loss if updating while editor crashed
This commit is contained in:
parent
b379f89a7a
commit
d7f26fa27c
1 changed files with 5 additions and 0 deletions
|
@ -336,6 +336,11 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
getData() {
|
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() ?? "";
|
const content = this.watchdog.editor?.getData() ?? "";
|
||||||
|
|
||||||
// if content is only tags/whitespace (typically <p> </p>), then just make it empty,
|
// if content is only tags/whitespace (typically <p> </p>), then just make it empty,
|
||||||
|
|
Loading…
Add table
Reference in a new issue