mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Finish up the admin, make the admin dropdown a navigationlink so you can read the full long name
This commit is contained in:
parent
d95cf2d190
commit
d0e10ef330
23 changed files with 296 additions and 168 deletions
|
|
@ -189,13 +189,24 @@ struct DetectionSensorConfig: View {
|
|||
)
|
||||
}
|
||||
)
|
||||
.onAppear {
|
||||
// Need to request a Detection Sensor Module Config from the remote node before allowing changes
|
||||
if bleManager.connectedPeripheral != nil && node?.detectionSensorConfig == nil {
|
||||
Logger.mesh.info("empty detection sensor module config")
|
||||
let connectedNode = getNodeInfo(id: bleManager.connectedPeripheral.num, context: context)
|
||||
if node != nil && connectedNode != nil {
|
||||
_ = bleManager.requestDetectionSensorModuleConfig(fromUser: connectedNode!.user!, toUser: node!.user!, adminIndex: connectedNode?.myInfo?.adminIndex ?? 0)
|
||||
.onFirstAppear {
|
||||
// Need to request a DetectionSensorModuleConfig from the remote node before allowing changes
|
||||
if let connectedPeripheral = bleManager.connectedPeripheral, let node {
|
||||
Logger.mesh.info("empty detection sensor config")
|
||||
let connectedNode = getNodeInfo(id: connectedPeripheral.num, context: context)
|
||||
if let connectedNode {
|
||||
if node.num != connectedNode.num {
|
||||
if UserDefaults.enableAdministration && node.num != connectedNode.num {
|
||||
/// 2.5 Administration with session passkey
|
||||
let expiration = node.sessionExpiration ?? Date()
|
||||
if expiration < Date() || node.detectionSensorConfig == nil {
|
||||
_ = bleManager.requestDetectionSensorModuleConfig(fromUser: connectedNode.user!, toUser: node.user!, adminIndex: connectedNode.myInfo?.adminIndex ?? 0)
|
||||
}
|
||||
} else {
|
||||
/// Legacy Administration
|
||||
_ = bleManager.requestDetectionSensorModuleConfig(fromUser: connectedNode.user!, toUser: node.user!, adminIndex: connectedNode.myInfo?.adminIndex ?? 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue