mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Delete broadcast user
This commit is contained in:
parent
cdc4288278
commit
e798cd3e7a
1 changed files with 16 additions and 0 deletions
|
|
@ -592,6 +592,22 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
case .max:
|
||||
print("MAX PORT NUM OF 511")
|
||||
}
|
||||
|
||||
// MARK: Check for an All / Broadcast User and delete it as a transition to multi channel
|
||||
let fetchBCUserRequest: NSFetchRequest<NSFetchRequestResult> = NSFetchRequest.init(entityName: "UserEntity")
|
||||
fetchBCUserRequest.predicate = NSPredicate(format: "num == %lld", Int64(broadcastNodeNum))
|
||||
|
||||
do {
|
||||
let fetchedUser = try context?.fetch(fetchBCUserRequest) as! [UserEntity]
|
||||
if fetchedUser.count > 0 {
|
||||
|
||||
context?.delete(fetchedUser[0])
|
||||
print("🗑️ Deleted the All - Broadcast User")
|
||||
}
|
||||
|
||||
} catch {
|
||||
MeshLogger.log("💥 Error Deleting the All - Broadcast User")
|
||||
}
|
||||
|
||||
// MARK: Share Location Position Update Timer
|
||||
// Use context to pass the radio name with the timer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue