mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 02:07:39 +08:00
ChecklistEditor: Mark note as empty is it only has one blank item
This commit is contained in:
@ -165,6 +165,12 @@ class ChecklistEditorState extends State<ChecklistEditor>
|
||||
@override
|
||||
Note getNote() {
|
||||
var note = checklist.note;
|
||||
if (checklist.items.length == 1) {
|
||||
var item = checklist.items.first;
|
||||
if (item.checked == false && item.text.trim().isEmpty) {
|
||||
note.body = "";
|
||||
}
|
||||
}
|
||||
note.title = _titleTextController.text.trim();
|
||||
note.type = NoteType.Checklist;
|
||||
return note;
|
||||
|
Reference in New Issue
Block a user