Skip to content

Commit

Permalink
Only notify frontend known improv devices (#3184)
Browse files Browse the repository at this point in the history
  • Loading branch information
bgoncal authored Nov 22, 2024
1 parent 38f31e9 commit 88b1b67
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Sources/App/WebView/WebViewExternalMessageHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -424,12 +424,14 @@ extension WebViewExternalMessageHandler: @preconcurrency ImprovManagerDelegate {
@MainActor
func didUpdateFoundDevices(devices: [String: CBPeripheral]) {
devices.forEach { [weak self] _, value in
self?.sendExternalBus(message: .init(
command: WebViewExternalBusOutgoingMessage.improvDiscoveredDevice.rawValue,
payload: [
"name": value.name ?? "unknown",
]
))
if let name = value.name {
self?.sendExternalBus(message: .init(
command: WebViewExternalBusOutgoingMessage.improvDiscoveredDevice.rawValue,
payload: [
"name": name,
]
))
}
}
}
}

0 comments on commit 88b1b67

Please sign in to comment.