Skip to content

Commit

Permalink
Only notify frontend known improv devices
Browse files Browse the repository at this point in the history
  • Loading branch information
bgoncal committed Nov 22, 2024
1 parent 38f31e9 commit 15964ca
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 15964ca

Please sign in to comment.