Fix network menu to remove duplicate ssids

This commit is contained in:
Jas-SinghFSU
2024-07-06 00:31:42 -07:00
parent ce54b7a6d8
commit e6c00e0532
6 changed files with 76 additions and 23 deletions

View File

@@ -5,6 +5,15 @@ import { renderWapStaging } from "./APStaging.js";
const Staging = Variable({});
const Connecting = Variable("");
const searchInProgress = Variable(false);
const startRotation = () => {
searchInProgress.value = true;
setTimeout(() => {
searchInProgress.value = false;
}, 5 * 1000);
};
const Wifi = () => {
return Widget.Box({
class_name: "menu-section-container wifi",
@@ -13,12 +22,29 @@ const Wifi = () => {
Widget.Box({
class_name: "menu-label-container",
hpack: "fill",
child: Widget.Label({
class_name: "menu-label",
hexpand: true,
hpack: "start",
label: "Wi-Fi",
}),
children: [
Widget.Label({
class_name: "menu-label",
hexpand: true,
hpack: "start",
label: "Wi-Fi",
}),
Widget.Button({
vpack: "center",
hpack: "end",
class_name: "menu-icon-button search network",
on_primary_click: () => {
startRotation();
network.wifi.scan();
},
child: Widget.Icon({
class_name: searchInProgress
.bind("value")
.as((v) => (v ? "spinning" : "")),
icon: "view-refresh-symbolic",
}),
}),
],
}),
Widget.Box({
class_name: "menu-items-section",