diff --git a/lib/appstate.dart b/lib/appstate.dart index 20e6bda8..4754aed4 100644 --- a/lib/appstate.dart +++ b/lib/appstate.dart @@ -22,7 +22,10 @@ class AppState { // /// This is the directory where all the git repos are stored String gitBaseDirectory = ""; - bool hasJournalEntries = false; + + bool get hasJournalEntries { + return notes.isNotEmpty; + } bool isLoadingFromDisk = false; List<Note> notes = []; diff --git a/lib/state_container.dart b/lib/state_container.dart index 624eec2a..75eba150 100644 --- a/lib/state_container.dart +++ b/lib/state_container.dart @@ -86,7 +86,6 @@ class StateContainerState extends State<StateContainer> { setState(() { appState.isLoadingFromDisk = false; appState.notes = loadedNotes; - appState.hasJournalEntries = loadedNotes.isNotEmpty; getAnalytics().logEvent( name: "notes_loaded", @@ -125,7 +124,6 @@ class StateContainerState extends State<StateContainer> { setState(() { appState.isLoadingFromDisk = false; appState.notes = loadedNotes; - appState.hasJournalEntries = loadedNotes.isNotEmpty; }); } catch (err, stack) { setState(() { @@ -198,7 +196,6 @@ class StateContainerState extends State<StateContainer> { note.filePath = p.join(noteRepo.notesBasePath, getFileName(note)); } appState.notes.insert(index, note); - appState.hasJournalEntries = true; noteRepo.addNote(note).then((NoteRepoResult _) { _syncNotes(); });