[AGS] Potential fix for network crash

This commit is contained in:
Janis Hutz 2025-04-26 13:03:38 +02:00
parent a8e0c903c4
commit d72c4fdf86

View File

@ -29,7 +29,10 @@ const Network = () => {
)} )}
cssClasses={["title-2"]} cssClasses={["title-2"]}
></label> ></label>
<label <box child=
{bind(net, 'wired').as(v => {
if (v) {
return <label
label={bind(net.wired, "state").as(state => { label={bind(net.wired, "state").as(state => {
if (state === STATE.ACTIVATED) { if (state === STATE.ACTIVATED) {
return ( return (
@ -52,6 +55,10 @@ const Network = () => {
})} })}
visible={bind(net.wifi, "enabled").as(v => !v)} visible={bind(net.wifi, "enabled").as(v => !v)}
></label> ></label>
} else {
return <label label={"State unavailable"}></label>
}
})}></box>
<label <label
label={bind(net.wifi, "state").as(state => { label={bind(net.wifi, "state").as(state => {
if (state === STATE.ACTIVATED) { if (state === STATE.ACTIVATED) {
@ -75,7 +82,7 @@ const Network = () => {
></label> ></label>
</box> </box>
} }
></button> ></button >
<button <button
cssClasses={["actions-button"]} cssClasses={["actions-button"]}
visible={networkHelper.networkEnabled()} visible={networkHelper.networkEnabled()}
@ -83,12 +90,12 @@ const Network = () => {
child={ child={
<box> <box>
<image iconName={"arrow-right-symbolic"}></image> <image iconName={"arrow-right-symbolic"}></image>
{ netMenu } {netMenu}
</box> </box>
} }
tooltipText={"View available devices"} tooltipText={"View available devices"}
></button> ></button>
</box> </box >
); );
}; };