From 8b48650ad8914763cd0632de9a7c414c605b2bfe Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Wed, 11 Mar 2020 12:55:07 +0100 Subject: [PATCH] Note: Reload the file when it changes We were comparing the file modification date incorrectly Fixes #65 --- lib/core/note.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/core/note.dart b/lib/core/note.dart index b5081ec3..50d80935 100644 --- a/lib/core/note.dart +++ b/lib/core/note.dart @@ -1,5 +1,6 @@ import 'dart:io'; +import 'package:fimber/fimber.dart'; import 'package:gitjournal/core/note_notifier.dart'; import 'package:gitjournal/settings.dart'; import 'package:gitjournal/utils/markdown.dart'; @@ -142,9 +143,10 @@ class Note with NotesNotifier { final file = File(_filePath); if (_loadState == NoteLoadState.Loaded) { var fileLastModified = file.lastModifiedSync(); - if (fileLastModified == fileLastModified) { + if (this.fileLastModified == fileLastModified) { return _loadState; } + Fimber.d("Note modified: $_filePath"); } if (!file.existsSync()) {