Only ask for install perm. for non-track-only apps

This commit is contained in:
Imran Remtulla
2022-11-25 19:07:05 -05:00
parent d29534ef2e
commit 42475fa42a
4 changed files with 31 additions and 19 deletions

View File

@@ -155,15 +155,19 @@ class _AddAppPageState extends State<AddAppPage> {
} }
if (cont) { if (cont) {
HapticFeedback.selectionClick(); HapticFeedback.selectionClick();
App app = await sourceProvider.getApp( var trackOnly = pickedSource!
pickedSource!, .enforceTrackOnly ||
userInput, userPickedTrackOnly;
sourceSpecificAdditionalData, App app =
trackOnly: pickedSource! await sourceProvider.getApp(
.enforceTrackOnly || pickedSource!,
userPickedTrackOnly); userInput,
await settingsProvider sourceSpecificAdditionalData,
.getInstallPermission(); trackOnly: trackOnly);
if (!trackOnly) {
await settingsProvider
.getInstallPermission();
}
// Only download the APK here if you need to for the package ID // Only download the APK here if you need to for the package ID
if (sourceProvider if (sourceProvider
.isTempId(app.id) && .isTempId(app.id) &&

View File

@@ -223,13 +223,17 @@ class _AppPageState extends State<AppPage> {
!appsProvider.areDownloadsRunning() !appsProvider.areDownloadsRunning()
? () { ? () {
HapticFeedback.heavyImpact(); HapticFeedback.heavyImpact();
appsProvider settingsProvider
.downloadAndInstallLatestApps( .getInstallPermission()
[app!.app.id], .then((value) {
context).then((res) { appsProvider
if (res.isNotEmpty && mounted) { .downloadAndInstallLatestApps(
Navigator.of(context).pop(); [app!.app.id],
} context).then((res) {
if (res.isNotEmpty && mounted) {
Navigator.of(context).pop();
}
});
}).catchError((e) { }).catchError((e) {
showError(e, context); showError(e, context);
}); });

View File

@@ -428,8 +428,13 @@ class AppsPageState extends State<AppsPage> {
findGeneratedFormValueByKey(formInputs, findGeneratedFormValueByKey(formInputs,
values, 'trackonlies') == values, 'trackonlies') ==
'true'; 'true';
settingsProvider (() async {
.getInstallPermission() if (shouldInstallNew ||
shouldInstallUpdates) {
await settingsProvider
.getInstallPermission();
}
})()
.then((_) { .then((_) {
List<String> toInstall = []; List<String> toInstall = [];
if (shouldInstallUpdates) { if (shouldInstallUpdates) {

View File

@@ -41,7 +41,6 @@ class _ImportExportPageState extends State<ImportExportPage> {
); );
Future<List<List<String>>> addApps(List<String> urls) async { Future<List<List<String>>> addApps(List<String> urls) async {
await settingsProvider.getInstallPermission();
List<dynamic> results = await sourceProvider.getAppsByURLNaive(urls, List<dynamic> results = await sourceProvider.getAppsByURLNaive(urls,
ignoreUrls: appsProvider.apps.values.map((e) => e.app.url).toList()); ignoreUrls: appsProvider.apps.values.map((e) => e.app.url).toList());
List<App> apps = results[0]; List<App> apps = results[0];