Prevent showing disconnected icon when connected on another device

This commit is contained in:
Ryan Hughes
2026-07-27 11:29:03 -04:00
parent 88ef6ca597
commit 2fb33a2a6a
+9 -2
View File
@@ -377,12 +377,19 @@ Panel {
return Model.formatPacketLoss(percent)
}
// Prefer a connected device: a machine can expose several NICs of the
// same type (e.g. an idle onboard port alongside the active adapter),
// and the first-enumerated one may be carrierless.
function findDevice(type) {
var devices = networkDevices || []
var fallback = null
for (var i = 0; i < devices.length; i++) {
if (devices[i] && devices[i].type === type) return devices[i]
var device = devices[i]
if (!device || device.type !== type) continue
if (device.connected) return device
if (!fallback) fallback = device
}
return null
return fallback
}
function findConnectedWifiNetwork() {