From 795c8a8eddfc4a2cc79341405cdfb201faf0ad7f Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Mon, 29 Dec 2025 20:10:03 -0800 Subject: [PATCH] Use let instead of nil check for connect battery icon --- Meshtastic/Views/Connect/Connect.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Meshtastic/Views/Connect/Connect.swift b/Meshtastic/Views/Connect/Connect.swift index 8a9d473d..cb6b2574 100644 --- a/Meshtastic/Views/Connect/Connect.swift +++ b/Meshtastic/Views/Connect/Connect.swift @@ -44,8 +44,8 @@ struct Connect: View { VStack(alignment: .center) { CircleText(text: node?.user?.shortName?.addingVariationSelectors ?? "?", color: Color(UIColor(hex: UInt32(node?.num ?? 0))), circleSize: 90) .padding(.trailing, 5) - if node?.latestDeviceMetrics != nil { - BatteryCompact(batteryLevel: node?.latestDeviceMetrics?.batteryLevel ?? 0, font: .caption, iconFont: .callout, color: .accentColor) + if let metrics = node?.latestDeviceMetrics { + BatteryCompact(batteryLevel: metrics.batteryLevel, font: .caption, iconFont: .callout, color: .accentColor) .padding(.trailing, 5) } }