mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-28 01:45:55 +08:00
Note: Reload the file when it changes
We were comparing the file modification date incorrectly Fixes #65
This commit is contained in:
@ -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()) {
|
||||
|
Reference in New Issue
Block a user