Skip to content

Commit

Permalink
fixed host switch load failing
Browse files Browse the repository at this point in the history
  • Loading branch information
clragon committed Jun 18, 2021
1 parent bcd0bdd commit 60e0aa6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/interface/data/provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ abstract class DataProvider<T> extends ChangeNotifier {
this.search.value = search ?? '';
[db.host, db.credentials, this.search]
.forEach((element) => element.addListener(resetPages));
isLoading = true;
onInit();
}

Expand Down Expand Up @@ -68,20 +69,20 @@ abstract class DataProvider<T> extends ChangeNotifier {
if (updateLock.isLocked) {
return;
}
isLoading = true;
await updateLock.acquire();
isLoading = true;
notifyListeners();
int page = reset ? 1 : pages.value.length + 1;

await addPage(await loadPage(page), reset: reset);

isLoading = false;
notifyListeners();
updateLock.release();
if (isRestarting) {
isRestarting = false;
resetPages();
}
updateLock.release();
}

@override
Expand Down

0 comments on commit 60e0aa6

Please sign in to comment.