Switch back to parallelized BG task (#963) + better logging

This commit is contained in:
Imran Remtulla
2023-10-13 23:39:24 -04:00
parent f6c6cd5cb8
commit 7f3e87767c
6 changed files with 143 additions and 107 deletions

View File

@@ -292,7 +292,7 @@ class _AppPageState extends State<AppPage> {
if (source?.enforceTrackOnly == true) {
app.app.additionalSettings['trackOnly'] = true;
// ignore: use_build_context_synchronously
showError(tr('appsFromSourceAreTrackOnly'), context);
showMessage(tr('appsFromSourceAreTrackOnly'), context);
}
if (app.app.additionalSettings['versionDetection'] ==
'releaseDateAsVersion') {
@@ -343,7 +343,7 @@ class _AppPageState extends State<AppPage> {
);
if (app?.app.installedVersion != null && !trackOnly) {
// ignore: use_build_context_synchronously
showError(tr('appsUpdated'), context);
showMessage(tr('appsUpdated'), context);
}
if (res.isNotEmpty && mounted) {
Navigator.of(context).pop();

View File

@@ -705,7 +705,7 @@ class AppsPageState extends State<AppsPage> {
return <String>[];
}).then((value) {
if (shouldInstallUpdates) {
showError(tr('appsUpdated'), context);
showMessage(tr('appsUpdated'), context);
}
});
}

View File

@@ -81,7 +81,7 @@ class _ImportExportPageState extends State<ImportExportPage> {
});
appsProvider.addAppsByURL(urls).then((errors) {
if (errors.isEmpty) {
showError(tr('importedX', args: [plural('apps', urls.length)]),
showMessage(tr('importedX', args: [plural('apps', urls.length)]),
context);
} else {
showDialog(
@@ -111,7 +111,7 @@ class _ImportExportPageState extends State<ImportExportPage> {
sp: settingsProvider)
.then((String? result) {
if (result != null) {
showError(tr('exportedTo', args: [result]), context);
showMessage(tr('exportedTo', args: [result]), context);
}
}).catchError((e) {
showError(e, context);
@@ -141,7 +141,7 @@ class _ImportExportPageState extends State<ImportExportPage> {
}
});
appsProvider.addMissingCategories(settingsProvider);
showError(tr('importedX', args: [plural('apps', value)]), context);
showMessage(tr('importedX', args: [plural('apps', value)]), context);
});
} else {
// User canceled the picker
@@ -216,7 +216,7 @@ class _ImportExportPageState extends State<ImportExportPage> {
var errors = await appsProvider.addAppsByURL(selectedUrls);
if (errors.isEmpty) {
// ignore: use_build_context_synchronously
showError(
showMessage(
tr('importedX',
args: [plural('apps', selectedUrls.length)]),
context);
@@ -274,7 +274,7 @@ class _ImportExportPageState extends State<ImportExportPage> {
var errors = await appsProvider.addAppsByURL(selectedUrls);
if (errors.isEmpty) {
// ignore: use_build_context_synchronously
showError(
showMessage(
tr('importedX', args: [plural('apps', selectedUrls.length)]),
context);
} else {

View File

@@ -535,7 +535,7 @@ class _SettingsPageState extends State<SettingsPage> {
onPressed: () {
context.read<LogsProvider>().get().then((logs) {
if (logs.isEmpty) {
showError(ObtainiumError(tr('noLogs')), context);
showMessage(ObtainiumError(tr('noLogs')), context);
} else {
showDialog(
context: context,
@@ -577,7 +577,7 @@ class _SettingsPageState extends State<SettingsPage> {
const Duration(seconds: 0),
bgUpdateCheckAlarmId + 200,
bgUpdateCheck);
showError(tr('bgTaskStarted'), context);
showMessage(tr('bgTaskStarted'), context);
},
child: Text(tr('runBgCheckNow')))
],