mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
invalidate existing timer before creating a new one
This commit is contained in:
parent
e5465713ba
commit
c8dc97acb6
1 changed files with 3 additions and 0 deletions
|
|
@ -168,6 +168,9 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
|
||||
self.centralManager?.connect(peripheral)
|
||||
|
||||
// Invalidate any existing timer
|
||||
self.timeoutTimer?.invalidate()
|
||||
|
||||
// Use a timer to keep track of connecting peripherals, context to pass the radio name with the timer and the RunLoop to prevent
|
||||
// the timer from running on the main UI thread
|
||||
let context = ["name": "@\(peripheral.name ?? "Unknown")"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue