From 9b89615856b23ef4318d59baf4d9df1fa75604c4 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Thu, 13 Oct 2022 16:33:33 -0700 Subject: [PATCH] Try and build for mac ventura --- Meshtastic/Views/Helpers/BatteryGauge.swift | 4 ++++ Meshtastic/Views/Nodes/DeviceMetricsLog.swift | 6 ++++++ 2 files changed, 10 insertions(+) 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 {