mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 14:39:34 +01:00
fix: isNoteEmpty causing crashes
This commit is contained in:
@@ -225,7 +225,9 @@ function isNoteEmpty(note) {
|
|||||||
locked,
|
locked,
|
||||||
} = note;
|
} = note;
|
||||||
const isTitleEmpty = !title || !title.trim().length;
|
const isTitleEmpty = !title || !title.trim().length;
|
||||||
const isTextEmpty = !isHex(text) && (!text || !text.trim().length);
|
let textLength =
|
||||||
|
text.data != null ? text.data.trim().length : text.trim().length;
|
||||||
|
const isTextEmpty = !isHex(text) && (!text || !textLength);
|
||||||
const isDeltaEmpty = !isHex(delta) && (!delta || !delta.ops);
|
const isDeltaEmpty = !isHex(delta) && (!delta || !delta.ops);
|
||||||
return !locked && isTitleEmpty && isTextEmpty && isDeltaEmpty;
|
return !locked && isTitleEmpty && isTextEmpty && isDeltaEmpty;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user