mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
d51b8887ee
commit
30d150e3aa
1 changed files with 5 additions and 1 deletions
|
|
@ -499,7 +499,11 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
|
||||
let traceRoute = TraceRouteEntity(context: context)
|
||||
let nodes = NodeInfoEntity.fetchRequest()
|
||||
nodes.predicate = NSPredicate(format: "num IN %@", [destNum, self.connectedPeripheral?.num ?? 0])
|
||||
if let connectedNum = self.connectedPeripheral?.num {
|
||||
nodes.predicate = NSPredicate(format: "num IN %@", [destNum, connectedNum])
|
||||
} else {
|
||||
nodes.predicate = NSPredicate(format: "num == %@", destNum)
|
||||
}
|
||||
do {
|
||||
let fetchedNodes = try context.fetch(nodes)
|
||||
let receivingNode = fetchedNodes.first(where: { $0.num == destNum })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue