File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,14 @@ class NoteSerializer implements NoteSerializerInterface {
29
29
else
30
30
data.props.remove (settings.modifiedKey);
31
31
32
- if (note.title != null && note.title.isNotEmpty)
33
- data.props[settings.titleKey] = note.title;
32
+ if (note.title != null ) {
33
+ var title = note.title.trim ();
34
+ if (title.isNotEmpty)
35
+ data.props[settings.titleKey] = note.title;
36
+ else
37
+ data.props.remove (settings.titleKey);
38
+ } else
39
+ data.props.remove (settings.titleKey);
34
40
35
41
data.body = note.body;
36
42
}
@@ -40,6 +46,6 @@ class NoteSerializer implements NoteSerializerInterface {
40
46
note.body = data.body;
41
47
note.created = parseDateTime (data.props[settings.createdKey]? .toString ());
42
48
note.modified = parseDateTime (data.props[settings.modifiedKey]? .toString ());
43
- note.title = data.props[settings.titleKey]? .toString ();
49
+ note.title = data.props[settings.titleKey]? .toString () ?? "" ;
44
50
}
45
51
}
You can’t perform that action at this time.
0 commit comments