adjusting timeout for wifinetwork

This commit is contained in:
Satoxyan
2025-03-11 14:03:59 +07:00
parent db4a6d953e
commit ad63420198
@@ -81,7 +81,8 @@ const NetResource = (icon, command) => {
const CurrentNetwork = () => { const CurrentNetwork = () => {
let authLock = false; let authLock = false;
// console.log(Network.wifi); let timeoutId = null;
const bottomSeparator = Box({ const bottomSeparator = Box({
className: 'separator-line', className: 'separator-line',
}); });
@@ -138,7 +139,7 @@ const CurrentNetwork = () => {
}), }),
Entry({ Entry({
className: 'sidebar-wifinetworks-auth-entry', className: 'sidebar-wifinetworks-auth-entry',
visibility: false, // Password dots visibility: false,
onAccept: (self) => { onAccept: (self) => {
authLock = false; authLock = false;
networkAuth.revealChild = false; networkAuth.revealChild = false;
@@ -155,6 +156,14 @@ const CurrentNetwork = () => {
authLock = true; authLock = true;
connectAttempt = Network.wifi.ssid; connectAttempt = Network.wifi.ssid;
self.revealChild = true; self.revealChild = true;
if (timeoutId) {
clearTimeout(timeoutId);
}
timeoutId = setTimeout(() => {
authLock = false;
self.revealChild = false;
Network.wifi.state = 'activated';
}, 20000); // 20 seconds timeout
} }
}), }),
}); });