From 6b7d962b8795b630ee5a4533908032f5c28113d7 Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Thu, 30 Mar 2023 17:44:39 -0400 Subject: [PATCH] Bugfix: "releaseDateAsVersion" resets to "noVersionDetection" Also 2 related UI fixes --- lib/pages/app.dart | 6 +++--- lib/providers/apps_provider.dart | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/pages/app.dart b/lib/pages/app.dart index 701cb56..3e015de 100644 --- a/lib/pages/app.dart +++ b/lib/pages/app.dart @@ -80,9 +80,7 @@ class _AppPageState extends State { ), Text( '${tr('installedVersionX', args: [ - app?.installedInfo?.versionName ?? - app?.app.installedVersion ?? - tr('none') + app?.app.installedVersion ?? tr('none') ])}${trackOnly ? ' ${tr('estimateInBrackets')}\n\n${tr('xIsTrackOnly', args: [ tr('app') ])}' : ''}', @@ -249,6 +247,8 @@ class _AppPageState extends State { if (e.key == 'versionDetection' && e is GeneratedFormDropdown) { e.disabledOptKeys ??= []; if (app?.app.installedVersion != null && + app?.app.additionalSettings['versionDetection'] != + 'releaseDateAsVersion' && !appsProvider.isVersionDetectionPossible(app)) { e.disabledOptKeys!.add('standardVersionDetection'); } diff --git a/lib/providers/apps_provider.dart b/lib/providers/apps_provider.dart index cf19488..2afd95e 100644 --- a/lib/providers/apps_provider.dart +++ b/lib/providers/apps_provider.dart @@ -486,6 +486,8 @@ class AppsProvider with ChangeNotifier { bool isVersionDetectionPossible(AppInMemory? app) { return app?.app.additionalSettings['trackOnly'] != true && + app?.app.additionalSettings['versionDetection'] != + 'releaseDateAsVersion' && app?.installedInfo?.versionName != null && app?.app.installedVersion != null && reconcileVersionDifferences( @@ -539,6 +541,8 @@ class AppsProvider with ChangeNotifier { } // FOURTH, DISABLE VERSION DETECTION IF ENABLED AND THE REPORTED/REAL INSTALLED VERSIONS ARE NOT STANDARDIZED if (installedInfo != null && + app.additionalSettings['versionDetection'] == + 'standardVersionDetection' && !isVersionDetectionPossible(AppInMemory(app, null, installedInfo))) { app.additionalSettings['versionDetection'] = 'noVersionDetection'; logs.add('Could not reconcile version formats for: ${app.id}');