More work on silent updates (not working in BG)

This commit is contained in:
Imran Remtulla
2022-09-24 18:43:05 -04:00
parent b65c6e1d41
commit 0a9373e65a
6 changed files with 73 additions and 33 deletions

View File

@@ -25,8 +25,8 @@ class _AppPageState extends State<AppPage> {
var sourceProvider = SourceProvider();
AppInMemory? app = appsProvider.apps[widget.appId];
var source = app != null ? sourceProvider.getSource(app.app.url) : null;
if (!appsProvider.areDownloadsRunning()) {
appsProvider.getUpdate(app!.app.id).catchError((e) {
if (!appsProvider.areDownloadsRunning() && app != null) {
appsProvider.getUpdate(app.app.id).catchError((e) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(e.toString())),
);
@@ -221,7 +221,7 @@ class _AppPageState extends State<AppPage> {
.downloadAndInstallLatestApp(
[app!.app.id],
context).then((res) {
if (res && mounted) {
if (res.isNotEmpty && mounted) {
Navigator.of(context).pop();
}
});