Address code review feedback: use @ObservedObject for LocationsHandler, fix firmware label

Agent-Logs-Url: https://github.com/meshtastic/Meshtastic-Apple/sessions/449fe2d6-dec9-4509-920e-e6196ca11d65

Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-04-06 00:21:38 +00:00 committed by GitHub
parent eabb9a9d30
commit 8c6f61ff5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 5 deletions

View file

@ -14,6 +14,7 @@ struct DeviceOnboarding: View {
}
@EnvironmentObject var accessoryManager: AccessoryManager
@ObservedObject private var locationsHandler: LocationsHandler = .shared
@State var navigationPath: [SetupGuide] = []
@State var locationStatus = LocationsHandler.shared.manager.authorizationStatus
@AppStorage("provideLocation") private var provideLocation: Bool = false
@ -239,10 +240,7 @@ struct DeviceOnboarding: View {
title: String(localized: "Battery Usage"),
subtitle: String(localized: "Enabling background activity may increase battery usage. You can toggle this at any time in the app settings.")
)
Toggle(isOn: Binding(
get: { LocationsHandler.shared.backgroundActivity },
set: { LocationsHandler.shared.backgroundActivity = $0 }
)) {
Toggle(isOn: $locationsHandler.backgroundActivity) {
Label {
Text("Enable Background Activity")
} icon: {

View file

@ -62,7 +62,7 @@ struct Firmware: View {
.foregroundStyle(.red)
.font(.title2)
.padding(.bottom)
Text("Current Firmware Version: \(connectedVersion), Latest Firmware Version: \(accessoryManager.minimumVersion)")
Text("Current Firmware Version: \(connectedVersion), Minimum Required Version: \(accessoryManager.minimumVersion)")
.fixedSize(horizontal: false, vertical: true)
.font(.title3)
.padding(.bottom)