Merge pull request #647 from 1xFF/fix-remove

fix race condition when checking updates
This commit is contained in:
Imran Remtulla
2023-07-09 01:01:07 -04:00
committed by GitHub

View File

@@ -785,8 +785,10 @@ class AppsProvider with ChangeNotifier {
if (attemptToCorrectInstallStatus) {
app = getCorrectedInstallStatusAppIfPossible(app, info) ?? app;
}
File('${(await getAppsDir()).path}/${app.id}.json')
.writeAsStringSync(jsonEncode(app.toJson()));
if (!onlyIfExists || this.apps.containsKey(app.id)) {
File('${(await getAppsDir()).path}/${app.id}.json')
.writeAsStringSync(jsonEncode(app.toJson()));
}
try {
this.apps.update(
app.id, (value) => AppInMemory(app, value.downloadProgress, info),