Network wifi section fix

This commit is contained in:
Jas-SinghFSU
2024-07-13 16:16:53 -07:00
parent 3fd8941123
commit b633650679
2 changed files with 11 additions and 9 deletions

View File

@@ -27,14 +27,13 @@ const renderWAPs = (self, network, staging, connecting) => {
}; };
self.hook(network, () => { self.hook(network, () => {
Utils.merge( Utils.merge(
[network.bind("wifi"), staging.bind("value"), connecting.bind("value")], [staging.bind("value"), connecting.bind("value")],
() => { () => {
// Sometimes the network service will yield a "this._device is undefined" when // Sometimes the network service will yield a "this._device is undefined" when
// trying to access the "access_points" property. So we must validate that // trying to access the "access_points" property. So we must validate that
// it's not 'undefined' // it's not 'undefined'
let WAPs = let WAPs =
Object.hasOwnProperty.call(network.wifi, "access_points") && network.wifi._device !== undefined
network.wifi["access_points"] !== undefined
? network.wifi["access-points"] ? network.wifi["access-points"]
: []; : [];
@@ -154,7 +153,7 @@ const renderWAPs = (self, network, staging, connecting) => {
class_name: "connection-status dim", class_name: "connection-status dim",
label: label:
WifiStatusMap[ WifiStatusMap[
network.wifi.state.toLowerCase() network.wifi.state.toLowerCase()
], ],
}), }),
}), }),
@@ -166,7 +165,7 @@ const renderWAPs = (self, network, staging, connecting) => {
hpack: "end", hpack: "end",
vpack: "start", vpack: "start",
reveal_child: reveal_child:
ap.bssid === connecting.value || isDisconnecting(ap), ap.bssid === connecting.value || isDisconnecting(ap),
child: Widget.Spinner({ child: Widget.Spinner({
vpack: "start", vpack: "start",
class_name: "spinner wap", class_name: "spinner wap",
@@ -179,7 +178,6 @@ const renderWAPs = (self, network, staging, connecting) => {
vpack: "start", vpack: "start",
reveal_child: ap.bssid !== connecting.value && ap.active, reveal_child: ap.bssid !== connecting.value && ap.active,
child: Widget.Button({ child: Widget.Button({
vpack: "start",
tooltip_text: "Delete/Forget Network", tooltip_text: "Delete/Forget Network",
class_name: "menu-icon-button network disconnect", class_name: "menu-icon-button network disconnect",
on_primary_click: () => { on_primary_click: () => {
@@ -205,7 +203,9 @@ const renderWAPs = (self, network, staging, connecting) => {
}, },
); );
}, },
child: Widget.Label("󰚃"), child: Widget.Label({
label: "󰚃"
}),
}), }),
}), }),
], ],

View File

@@ -77,9 +77,11 @@
} }
.menu-icon-button.network.disconnect { .menu-icon-button.network.disconnect {
margin-bottom: 0.4em; margin: 0em;
margin-top: -0.2em;
margin-left: 1em;
label { label {
font-size: 1.3em; font-size: 1.4em;
} }
&:hover { &:hover {
color: $mauve; color: $mauve;