From 9f2db4e4e7fbae7f8617063e687ff9cce255bfc9 Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Sat, 22 Apr 2023 21:40:15 -0400 Subject: [PATCH] App page 'reset install status' button shows if appropriate --- lib/pages/app.dart | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/lib/pages/app.dart b/lib/pages/app.dart index 815b6dc..2b40cdd 100644 --- a/lib/pages/app.dart +++ b/lib/pages/app.dart @@ -268,9 +268,7 @@ class _AppPageState extends State { }).toList(); return GeneratedFormModal( - title: tr('additionalOptions'), - items: items, - ); + title: tr('additionalOptions'), items: items); }); } @@ -307,6 +305,15 @@ class _AppPageState extends State { } } + getResetInstallStatusButton() => TextButton( + onPressed: app?.app == null + ? null + : () { + app!.app.installedVersion = null; + appsProvider.saveApps([app.app]); + }, + child: Text(tr('resetInstallStatus'))); + getInstallOrUpdateButton() => TextButton( onPressed: (app?.app.installedVersion == null || app?.app.installedVersion != app?.app.latestVersion) && @@ -402,7 +409,13 @@ class _AppPageState extends State { icon: const Icon(Icons.more_horiz), tooltip: tr('more')), const SizedBox(width: 16.0), - Expanded(child: getInstallOrUpdateButton()), + Expanded( + child: !isVersionDetectionStandard && + app?.app.installedVersion != null && + app?.app.installedVersion == + app?.app.latestVersion + ? getResetInstallStatusButton() + : getInstallOrUpdateButton()), const SizedBox(width: 16.0), Expanded( child: TextButton(