fix: keep inactive known Wi-Fi rows visible
Only mark an nmrs Wi-Fi group as activated when the group itself is active. Access points inherit device state, so inactive known networks on a connected Wi-Fi device can otherwise appear activated and get skipped from the known networks section while also being filtered out of visible networks.
This commit is contained in:
parent
829d66c44a
commit
9025430cf2
1 changed files with 4 additions and 1 deletions
|
|
@ -658,6 +658,7 @@ fn snapshot_to_applet(snapshot: NetworkSnapshot) -> AppletSnapshot {
|
|||
.filter(|group| group.known || group.active)
|
||||
.map(|group| {
|
||||
let strongest = &group.strongest;
|
||||
let device_state = DeviceState::from(&strongest.device_state);
|
||||
AccessPoint {
|
||||
ssid: Arc::from(group.ssid.as_str()),
|
||||
network_type: network_type(strongest.security),
|
||||
|
|
@ -665,8 +666,10 @@ fn snapshot_to_applet(snapshot: NetworkSnapshot) -> AppletSnapshot {
|
|||
strength: strongest.strength,
|
||||
state: if group.active {
|
||||
DeviceState::Activated
|
||||
} else if matches!(device_state, DeviceState::Activated) {
|
||||
DeviceState::Disconnected
|
||||
} else {
|
||||
DeviceState::from(&strongest.device_state)
|
||||
device_state
|
||||
},
|
||||
working: false,
|
||||
wps_push: strongest.security.wps,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue