mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-02 04:47:01 +08:00
Note: Always flush the file when writing
This may fix some edge cases where the notes aren't being saved.
This commit is contained in:
@ -50,7 +50,8 @@ class Note with NotesNotifier {
|
|||||||
NoteFileFormat _fileFormat;
|
NoteFileFormat _fileFormat;
|
||||||
|
|
||||||
MdYamlDoc _data = MdYamlDoc();
|
MdYamlDoc _data = MdYamlDoc();
|
||||||
NoteSerializer noteSerializer = NoteSerializer.fromSettings(Settings.instance);
|
NoteSerializer noteSerializer =
|
||||||
|
NoteSerializer.fromSettings(Settings.instance);
|
||||||
|
|
||||||
DateTime fileLastModified;
|
DateTime fileLastModified;
|
||||||
|
|
||||||
@ -295,7 +296,7 @@ class Note with NotesNotifier {
|
|||||||
|
|
||||||
var file = File(filePath);
|
var file = File(filePath);
|
||||||
var contents = _serializer.encode(data);
|
var contents = _serializer.encode(data);
|
||||||
await file.writeAsString(contents);
|
await file.writeAsString(contents, flush: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
String serialize() {
|
String serialize() {
|
||||||
|
Reference in New Issue
Block a user