CLASSROOMIO-T-135: Empty note state logic

Co-authored-by: Tunji Adeyemi <tunji@digdippa.com>


Merge-request: CLASSROOMIO-MR-61
Merged-by: Best Admin <best@digdippa.com>
This commit is contained in:
tunny17
2023-08-30 07:25:18 +00:00
committed by Space Cloud
parent 6a691d9fbd
commit ce63736b40
@@ -65,10 +65,13 @@
function isNoteEmpty(note) {
if (!note || typeof note !== 'string') return true;
if (!note.trim()) return true;
if (note.trim() === '<p><br></p>') return true;
return false;
const dummyDiv = document.createElement('div');
dummyDiv.innerHTML = note;
const rawText = dummyDiv.textContent?.trim();
return rawText === '';
}
function handleSave(prevMode: string) {