mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-30 11:33:34 +08:00
Wait for previous completion of loadNotes
Fixes APP-R
This commit is contained in:
@ -24,6 +24,7 @@ class StateContainer with ChangeNotifier {
|
|||||||
final AppState appState;
|
final AppState appState;
|
||||||
|
|
||||||
final _opLock = Lock();
|
final _opLock = Lock();
|
||||||
|
final _loadLock = Lock();
|
||||||
|
|
||||||
// FIXME: The gitRepo should never be changed once it has been setup
|
// FIXME: The gitRepo should never be changed once it has been setup
|
||||||
// We should always just be modifying the 'git remotes'
|
// We should always just be modifying the 'git remotes'
|
||||||
@ -82,8 +83,10 @@ class StateContainer with ChangeNotifier {
|
|||||||
|
|
||||||
Future<void> _loadNotes() async {
|
Future<void> _loadNotes() async {
|
||||||
// FIXME: We should report the notes that failed to load
|
// FIXME: We should report the notes that failed to load
|
||||||
|
return _loadLock.synchronized(() async {
|
||||||
await appState.notesFolder.loadRecursively();
|
await appState.notesFolder.loadRecursively();
|
||||||
await _notesCache.buildCache(appState.notesFolder);
|
await _notesCache.buildCache(appState.notesFolder);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> syncNotes({bool doNotThrow = false}) async {
|
Future<void> syncNotes({bool doNotThrow = false}) async {
|
||||||
|
Reference in New Issue
Block a user