diff --git a/lib/state_container.dart b/lib/state_container.dart index c836e2a0..b306f5bb 100644 --- a/lib/state_container.dart +++ b/lib/state_container.dart @@ -154,6 +154,7 @@ class StateContainerState extends State<StateContainer> { } void removeNote(Note note) { + // FIXME: What if the Note hasn't yet been saved? note.parent.remove(note); _gitRepo.removeNote(note.filePath).then((NoteRepoResult _) async { // FIXME: Is there a way of figuring this amount dynamically? diff --git a/lib/widgets/journal_list.dart b/lib/widgets/journal_list.dart index 598dface..1e3449f2 100644 --- a/lib/widgets/journal_list.dart +++ b/lib/widgets/journal_list.dart @@ -77,9 +77,8 @@ class JournalList extends StatelessWidget { var title = note.title; Widget titleWidget = Text(title, style: textTheme.title); if (title.isEmpty) { - var date = note.created; - if (date != null && date.year < 10) date = note.modified; - if (date != null && date.year > 10) { + var date = note.modified ?? note.created; + if (date != null) { var formatter = DateFormat('dd MMM, yyyy '); var dateStr = formatter.format(date);