From f1e18b699f0aa1d50f8c723f791019a622e53cf8 Mon Sep 17 00:00:00 2001 From: Per Olofsson Date: Thu, 31 Oct 2024 11:35:22 +0100 Subject: [PATCH] Avoid showing unsupported device UI if already running required major OS Incorrect data from SOFA or gdmf can cause Nudge to think that the required OS version is unsupported. If the device is already running the required major OS version, assume it's bad data and log a warning instead of displaying the unsupported device UI. --- Nudge/UI/Main.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Nudge/UI/Main.swift b/Nudge/UI/Main.swift index 0ba5a4bd..923e0a1b 100644 --- a/Nudge/UI/Main.swift +++ b/Nudge/UI/Main.swift @@ -342,7 +342,14 @@ class AppDelegate: NSObject, NSApplicationDelegate { supportedDevice in Globals.hardwareModelIDs.contains { $0.uppercased() == supportedDevice.uppercased() } } ) LogManager.notice("Assessed Model ID found in SOFA Entry: \(deviceMatchFound)", logger: sofaLog) - nudgePrimaryState.deviceSupportedByOSVersion = deviceMatchFound + let majorRequiredVersion = VersionManager.getMajorRequiredNudgeOSVersion() + let currentMajorVersion = VersionManager.getMajorOSVersion() + if !deviceMatchFound && (majorRequiredVersion == currentMajorVersion) { + LogManager.warning("Assessed Model ID not found in SOFA Entry, but device is already running required major OS version. Disregarding unsupported UI.", logger: sofaLog) + nudgePrimaryState.deviceSupportedByOSVersion = true + } else { + nudgePrimaryState.deviceSupportedByOSVersion = deviceMatchFound + } } } foundMatch = true