Hide indicator when not connected to Wi-Fi

This commit is contained in:
Jalil Arfaoui 2026-02-24 17:17:10 +01:00
parent b5099781eb
commit 8b1f1b3973

View file

@ -21,7 +21,6 @@ import {
type ConnectedInfo,
} from './wifiInfo.js';
import {
WIFI_GENERATIONS,
GENERATION_CSS_CLASSES,
getGenerationLabel,
getGenerationDescription,
@ -325,18 +324,17 @@ export default class WifiSignalPlusExtension extends Extension {
}
private updateIndicatorLabel(info: WifiConnectionInfo): void {
if (!this.icon || !this.label) return;
if (!this.indicator || !this.icon || !this.label) return;
this.clearGenerationStyles();
if (!isConnected(info)) {
this.icon.visible = false;
this.label.visible = true;
this.label.set_text('WiFi --');
this.label.add_style_class_name(GENERATION_CSS_CLASSES[WIFI_GENERATIONS.UNKNOWN]);
this.indicator.visible = false;
return;
}
this.indicator.visible = true;
const iconFilename = getGenerationIconFilename(info.generation);
if (iconFilename) {
const iconPath = GLib.build_filenamev([this.path, 'icons', iconFilename]);