From 7b0a5c80f35e99864cd353d2252d13f9d32b2439 Mon Sep 17 00:00:00 2001 From: Jake-B Date: Tue, 20 Jan 2026 17:24:11 -0500 Subject: [PATCH] Fix for macCatalyst code trying to build for iOS --- .../ESP32 OTA/ESP32OTAIntroSheet.swift | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/Meshtastic/Views/Settings/Firmware/ESP32 OTA/ESP32OTAIntroSheet.swift b/Meshtastic/Views/Settings/Firmware/ESP32 OTA/ESP32OTAIntroSheet.swift index 9a480a14..3a360ac8 100644 --- a/Meshtastic/Views/Settings/Firmware/ESP32 OTA/ESP32OTAIntroSheet.swift +++ b/Meshtastic/Views/Settings/Firmware/ESP32 OTA/ESP32OTAIntroSheet.swift @@ -171,17 +171,21 @@ struct ESP32OTAIntroSheet: View { } private var OTAMode: SupportedOTAMode { - if let connection = accessoryManager.activeConnection?.connection { - if connection is TCPConnection { - return .wifi - } else if connection is BLEConnection { - return .ble - } else if connection is SerialConnection { - return .wifi //DEBUG - } - + guard let connection = accessoryManager.activeConnection?.connection else { + return .none } - return .none - } + switch connection { + case is TCPConnection: + return .wifi + case is BLEConnection: + return .ble + #if targetEnvironment(macCatalyst) + case is SerialConnection: + return .wifi // DEBUG + #endif + default: + return .none + } + } }