Hide indicator when not connected to Wi-Fi
This commit is contained in:
parent
b5099781eb
commit
8b1f1b3973
1 changed files with 4 additions and 6 deletions
|
|
@ -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]);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue