wifi networks: hide network actions when not connected

This commit is contained in:
end-4
2025-03-28 18:45:30 +01:00
parent 04bee91d43
commit f2ad19f14b
@@ -216,17 +216,14 @@ const CurrentNetwork = () => {
if (activeSSID) {
execAsync(['nmcli', 'connection', 'delete', activeSSID])
.then(() => notify(`Forgot network: ${activeSSID}`))
.catch(err => notify(`Failed to forget network: ${err}`));
} else {
notify('No active network to forget');
.catch(err => Utils.notify(`Failed to forget network: ${err}`));
}
})
.catch(err => notify(`Error: ${err}`));
.catch(print);
},
setup: setupCursorHover,
});
const settingsButton = Button({
const propertiesButton = Button({
label: 'Properties',
className: 'txt sidebar-wifinetworks-network-button',
hexpand: true,
@@ -242,14 +239,22 @@ const CurrentNetwork = () => {
},
setup: setupCursorHover,
});
const networkProp = Box({
const networkProp = Revealer({
transition: 'slide_down',
transitionDuration: userOptions.animations.durationLarge,
child: Box({
className: 'spacing-h-10',
homogeneous: true,
children: [
settingsButton,
propertiesButton,
forgetButton,
],
setup: setupCursorHover,
}),
setup: (self) => self.hook(Network, (self) => {
if (Network.wifi?.ssid === '') self.revealChild = false;
else self.revealChild = true;
}),
});
networkAuth = Revealer({
transition: 'slide_down',