Wait for previous completion of loadNotes

Fixes APP-R
This commit is contained in:
Vishesh Handa
2020-04-16 09:22:17 +02:00
parent c14ffda409
commit bbaf5b4452

View File

@ -24,6 +24,7 @@ class StateContainer with ChangeNotifier {
final AppState appState;
final _opLock = Lock();
final _loadLock = Lock();
// FIXME: The gitRepo should never be changed once it has been setup
// We should always just be modifying the 'git remotes'
@ -82,8 +83,10 @@ class StateContainer with ChangeNotifier {
Future<void> _loadNotes() async {
// FIXME: We should report the notes that failed to load
return _loadLock.synchronized(() async {
await appState.notesFolder.loadRecursively();
await _notesCache.buildCache(appState.notesFolder);
});
}
Future<void> syncNotes({bool doNotThrow = false}) async {