Exclude connected network from nearby list by SSID instead of BSSID
This commit is contained in:
parent
7c771939e2
commit
be3ad57b67
2 changed files with 6 additions and 6 deletions
|
|
@ -118,7 +118,7 @@ export default class WifiSignalPlusExtension extends Extension {
|
|||
private nearbySection: PopupMenu.PopupMenuSection | null = null;
|
||||
private nearbyItems: NearbyNetworkCard[] = [];
|
||||
private nearbyUpdatePending = false;
|
||||
private currentConnectedBssid: string | undefined;
|
||||
private currentConnectedSsid: string | undefined;
|
||||
private isMenuOpen = false;
|
||||
private enableEpoch = 0;
|
||||
|
||||
|
|
@ -169,7 +169,7 @@ export default class WifiSignalPlusExtension extends Extension {
|
|||
this.nearbyItems = [];
|
||||
this.refreshPending = false;
|
||||
this.nearbyUpdatePending = false;
|
||||
this.currentConnectedBssid = undefined;
|
||||
this.currentConnectedSsid = undefined;
|
||||
this.isMenuOpen = false;
|
||||
}
|
||||
|
||||
|
|
@ -453,7 +453,7 @@ export default class WifiSignalPlusExtension extends Extension {
|
|||
const info = await this.wifiService.getConnectionInfo();
|
||||
if (!this.wifiService) return;
|
||||
|
||||
this.currentConnectedBssid = isConnected(info) ? info.bssid : undefined;
|
||||
this.currentConnectedSsid = isConnected(info) ? info.ssid : undefined;
|
||||
this.updateIndicatorLabel(info);
|
||||
this.updateMenuContent(info);
|
||||
|
||||
|
|
@ -619,7 +619,7 @@ export default class WifiSignalPlusExtension extends Extension {
|
|||
this.nearbyUpdatePending = true;
|
||||
let grouped: Map<string, ScannedNetwork[]>;
|
||||
try {
|
||||
grouped = await this.wifiService.getAvailableNetworks(this.currentConnectedBssid);
|
||||
grouped = await this.wifiService.getAvailableNetworks(this.currentConnectedSsid);
|
||||
} finally {
|
||||
this.nearbyUpdatePending = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ export class WifiInfoService {
|
|||
});
|
||||
}
|
||||
|
||||
async getAvailableNetworks(excludeBssid?: string): Promise<Map<string, ScannedNetwork[]>> {
|
||||
async getAvailableNetworks(excludeSsid?: string): Promise<Map<string, ScannedNetwork[]>> {
|
||||
if (!this.client) return new Map();
|
||||
|
||||
const wifiDevice = this.findWifiDevice();
|
||||
|
|
@ -155,10 +155,10 @@ export class WifiInfoService {
|
|||
|
||||
const ssid = this.decodeSsid(ap.get_ssid());
|
||||
if (!ssid) continue;
|
||||
if (excludeSsid && ssid === excludeSsid) continue;
|
||||
|
||||
const bssid = (ap.get_bssid() ?? '').toLowerCase();
|
||||
if (!bssid) continue;
|
||||
if (excludeBssid && bssid === excludeBssid.toLowerCase()) continue;
|
||||
|
||||
const frequency = asFrequencyMHz(ap.get_frequency());
|
||||
const generation = this.generationMap.get(bssid) ?? WIFI_GENERATIONS.UNKNOWN;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue