Merge pull request #401 from ImranR98/dev

Bugfix: "releaseDateAsVersion" resets to "noVersionDetection"
This commit is contained in:
Imran Remtulla
2023-03-30 17:45:24 -04:00
committed by GitHub
2 changed files with 7 additions and 3 deletions

View File

@@ -80,9 +80,7 @@ class _AppPageState extends State<AppPage> {
),
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<AppPage> {
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');
}

View File

@@ -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}');