mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
perferredPeripheralId fix
This commit is contained in:
parent
b4c749a978
commit
b327f13971
1 changed files with 4 additions and 9 deletions
|
|
@ -66,15 +66,6 @@ extension AccessoryManager {
|
|||
Logger.transport.info("[Accessory] Event stream closed")
|
||||
}
|
||||
self.activeConnection = (device: device, connection: connection)
|
||||
|
||||
// if we don't have a peripheralId, set it now at the beginning of the
|
||||
// connect process (because I think it is used in other parts of the app
|
||||
// during the connect process?
|
||||
// Otherwise, UserDefault.preferredPeripheralId is set in the Connect
|
||||
// view, as part of the "Connect to new radio?" confirmation dialog logic.
|
||||
if UserDefaults.preferredPeripheralId.isEmpty {
|
||||
UserDefaults.preferredPeripheralId = device.id.uuidString
|
||||
}
|
||||
} catch let error as CBError where error.code == .peerRemovedPairingInformation {
|
||||
await self.connectionStepper?.cancelCurrentlyExecutingStep(withError: AccessoryError.coreBluetoothError(error), cancelFullProcess: true)
|
||||
}
|
||||
|
|
@ -119,6 +110,10 @@ extension AccessoryManager {
|
|||
Logger.transport.info("🔗👟 [Connect] Step 5: Send wantConfig (database)")
|
||||
self.updateState(.retrievingDatabase(nodeCount: 0))
|
||||
self.allowDisconnect = true
|
||||
|
||||
Logger.transport.info("🔗 Saving preferredPeripheralId: \(device.id.uuidString)")
|
||||
UserDefaults.preferredPeripheralId = device.id.uuidString
|
||||
|
||||
try await self.sendWantDatabase()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue