File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff 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 ( ) ;
You can’t perform that action at this time.
0 commit comments