More UI tweaks

This commit is contained in:
Imran Remtulla
2022-08-18 22:40:57 -04:00
parent 821fd6934a
commit 15d5ac1eef
2 changed files with 74 additions and 32 deletions

View File

@@ -17,6 +17,7 @@ class AppsProvider with ChangeNotifier {
// In memory App state (should always be kept in sync with local storage versions)
Map<String, App> apps = {};
bool loadingApps = false;
bool gettingUpdates = false;
AppsProvider() {
initializeDownloader();
@@ -213,12 +214,17 @@ class AppsProvider with ChangeNotifier {
Future<List<App>> getUpdates() async {
List<App> updates = [];
List<String> appIds = apps.keys.toList();
for (int i = 0; i < appIds.length; i++) {
App? newApp = await getUpdate(appIds[i]);
if (newApp != null) {
updates.add(newApp);
if (!gettingUpdates) {
gettingUpdates = true;
List<String> appIds = apps.keys.toList();
for (int i = 0; i < appIds.length; i++) {
App? newApp = await getUpdate(appIds[i]);
if (newApp != null) {
updates.add(newApp);
}
}
gettingUpdates = false;
}
return updates;
}