Fix visibility

Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com>
This commit is contained in:
Ben Meadors 2026-04-08 13:26:57 -05:00 committed by GitHub
parent 3f9348e36f
commit 104cdd58f9
2 changed files with 14 additions and 6 deletions

View file

@ -29054,6 +29054,9 @@
}
}
}
},
"Loading TAK config from the node." : {
},
"Local Network Access" : {
"comment" : "A label displayed above the options for local network access.",

View file

@ -30,15 +30,20 @@ struct TAKModuleConfig: View {
return DeviceRoles(rawValue: Int(role))
}
private var isConnectedNode: Bool {
guard let node else { return false }
return node.num == accessoryManager.activeDeviceNum
}
var body: some View {
Form {
ConfigHeader(title: "TAK", config: \.takConfig, node: node, onAppear: setTAKValues)
if accessoryManager.isConnected, node?.takConfig == nil {
Section {
HStack(spacing: 12) {
ProgressView()
Text("Loading TAK config from the node.")
.foregroundColor(.secondary)
}
}
}
if let deviceRole, deviceRole != .tak && deviceRole != .takTracker {
Section {
Text("These settings only apply when the device role is TAK or TAK Tracker.")
@ -79,7 +84,7 @@ struct TAKModuleConfig: View {
.font(.callout)
}
}
.disabled(!accessoryManager.isConnected || (!isConnectedNode && node?.takConfig == nil))
.disabled(!accessoryManager.isConnected || node?.takConfig == nil)
.safeAreaInset(edge: .bottom, alignment: .center) {
HStack(spacing: 0) {
SaveConfigButton(node: node, hasChanges: $hasChanges) {