Less restrictive install permission requests (#488)

This commit is contained in:
Imran Remtulla
2023-04-30 00:02:23 -04:00
parent 392554123b
commit 81f66683d2
4 changed files with 10 additions and 12 deletions

View File

@@ -624,11 +624,6 @@ class AppsPageState extends State<AppsPage> {
bool shouldInstallNew = values['installs'] == true;
bool shouldMarkTrackOnlies = values['trackonlies'] == true;
(() async {
if (shouldInstallNew || shouldInstallUpdates) {
await settingsProvider.getInstallPermission();
}
})()
.then((_) {
List<String> toInstall = [];
if (shouldInstallUpdates) {
toInstall.addAll(existingUpdateIdsAllOrSelected);
@@ -639,6 +634,12 @@ class AppsPageState extends State<AppsPage> {
if (shouldMarkTrackOnlies) {
toInstall.addAll(trackOnlyUpdateIdsAllOrSelected);
}
if (toInstall.length > 1) {
// Permission is requested automatically, but if there are more than 1 installs,
// We want to explicitly request it and wait for the result to avoid multiple requests
await settingsProvider.getInstallPermission(
enforce: false);
}
appsProvider
.downloadAndInstallLatestApps(
toInstall, globalNavigatorKey.currentContext)