diff --git a/src/components/taskbar/index.jsx b/src/components/taskbar/index.jsx index 1d2387ae9..937d3fee4 100644 --- a/src/components/taskbar/index.jsx +++ b/src/components/taskbar/index.jsx @@ -41,6 +41,25 @@ const Taskbar = () => { dispatch({ type: "TASKPHIDE" }); }; + const [conectivityToggle, setConectivityToggle] = useState("wifi"); + const sidepane = useSelector((state) => state.sidepane); + + useEffect(() => { + const wifi = document.querySelector('[data-payload="network.wifi.state"]'); + let wifiState = wifi.getAttribute('data-state'); + + if (sidepane.quicks[2].ui === false) { + setConectivityToggle("airplane"); + wifiState = "false"; + } else { + setConectivityToggle("wifi"); + wifiState = "true"; + } + + // Update the data-state attribute of the wifi element + wifi.setAttribute('data-state', wifiState); + }, [sidepane.quicks[2].ui]); + const clickDispatch = (event) => { var action = { type: event.target.dataset.action, @@ -143,7 +162,7 @@ const Taskbar = () => { onClick={clickDispatch} data-action="PANETOGG" > - + { var tmpState = { ...state }; tmpState.quicks[4].src = action.payload; return tmpState; + } else if (action.type == "STNGTOGG" && action.payload === "network.airplane") { + var tmpState = { ...state }; + tmpState.quicks[2].ui = !tmpState.quicks[2].ui; + return tmpState; } else if (action.type == "BANDTOGG") { return { ...state, banhide: !state.banhide }; } else if (action.type == "BANDHIDE") { diff --git a/src/utils/apps.js b/src/utils/apps.js index ae853ad74..9ba252fa0 100644 --- a/src/utils/apps.js +++ b/src/utils/apps.js @@ -67,7 +67,8 @@ const apps = [ { name: "Blue", icon: "win/user", - type: "short", + type: "app", + action: "EXPLORER", }, { name: "Alarms",