diff --git a/Meshtastic/Views/Helpers/BatteryGauge.swift b/Meshtastic/Views/Helpers/BatteryGauge.swift index a68eeec0..6a996bd9 100644 --- a/Meshtastic/Views/Helpers/BatteryGauge.swift +++ b/Meshtastic/Views/Helpers/BatteryGauge.swift @@ -6,7 +6,9 @@ // import SwiftUI +#if canImport(Charts) import Charts +#endif struct BatteryGauge: View { @@ -18,6 +20,7 @@ struct BatteryGauge: View { var body: some View { VStack { + #if !targetEnvironment(macCatalyst) if batteryLevel == 0.0 { // Plugged in Image(systemName: "powerplug") @@ -47,6 +50,7 @@ struct BatteryGauge: View { .tint(gradient) .gaugeStyle(.accessoryCircular) } + #endif } } } diff --git a/Meshtastic/Views/Nodes/DeviceMetricsLog.swift b/Meshtastic/Views/Nodes/DeviceMetricsLog.swift index 14290db2..29b7a504 100644 --- a/Meshtastic/Views/Nodes/DeviceMetricsLog.swift +++ b/Meshtastic/Views/Nodes/DeviceMetricsLog.swift @@ -5,7 +5,9 @@ // Copyright(c) Garth Vander Houwen 7/7/22. // import SwiftUI +#if canImport(Charts) import Charts +#endif struct DeviceMetricsLog: View { @@ -35,6 +37,8 @@ struct DeviceMetricsLog: View { if data.count > 0 { + #if canImport(Charts) + GroupBox(label: Label("Battery Level Trend", systemImage: "battery.100")) { Chart(data.array as! [TelemetryEntity], id: \.self) { @@ -49,6 +53,8 @@ struct DeviceMetricsLog: View { } .frame(height: 150) } + + #endif } ScrollView {