Skip to content

Commit 7b5d166

Browse files
committed
update
1 parent ffea3b4 commit 7b5d166

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/mode/station.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,29 @@ impl Station {
240240
self.known_networks = known_networks;
241241
}
242242

243+
let available_networks_names: Vec<String> = self
244+
.known_networks
245+
.iter()
246+
.map(|(n, _)| n.name.clone())
247+
.collect();
248+
249+
let unavailable_known_networks =
250+
if let Ok(iwd_known_networks) = self.session.known_networks().await {
251+
let mut unavailable_known_networks = Vec::new();
252+
for iwd_network in iwd_known_networks {
253+
if let Ok(known_network) = KnownNetwork::new(iwd_network).await
254+
&& !available_networks_names.contains(&known_network.name)
255+
{
256+
unavailable_known_networks.push(known_network);
257+
}
258+
}
259+
unavailable_known_networks
260+
} else {
261+
Vec::new()
262+
};
263+
264+
self.unavailable_known_networks = unavailable_known_networks;
265+
243266
self.connected_network = connected_network;
244267

245268
let iwd_station_diagnostic = self.session.stations_diagnostics().await.unwrap().pop();

0 commit comments

Comments
 (0)