mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-28 18:03:14 +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 'dart:io';
|
||||||
|
|
||||||
|
import 'package:fimber/fimber.dart';
|
||||||
import 'package:gitjournal/core/note_notifier.dart';
|
import 'package:gitjournal/core/note_notifier.dart';
|
||||||
import 'package:gitjournal/settings.dart';
|
import 'package:gitjournal/settings.dart';
|
||||||
import 'package:gitjournal/utils/markdown.dart';
|
import 'package:gitjournal/utils/markdown.dart';
|
||||||
@ -142,9 +143,10 @@ class Note with NotesNotifier {
|
|||||||
final file = File(_filePath);
|
final file = File(_filePath);
|
||||||
if (_loadState == NoteLoadState.Loaded) {
|
if (_loadState == NoteLoadState.Loaded) {
|
||||||
var fileLastModified = file.lastModifiedSync();
|
var fileLastModified = file.lastModifiedSync();
|
||||||
if (fileLastModified == fileLastModified) {
|
if (this.fileLastModified == fileLastModified) {
|
||||||
return _loadState;
|
return _loadState;
|
||||||
}
|
}
|
||||||
|
Fimber.d("Note modified: $_filePath");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!file.existsSync()) {
|
if (!file.existsSync()) {
|
||||||
|
Reference in New Issue
Block a user