Skip to content

Commit

Permalink
Fixed minor bug in Settings_Wifi.html
Browse files Browse the repository at this point in the history
Minor Bug: If setting a SSID empty, then any followed network will be ignored
  • Loading branch information
JPZV committed Jan 18, 2024
1 parent acd524d commit b1d8baf
Show file tree
Hide file tree
Showing 2 changed files with 219 additions and 183 deletions.
31 changes: 29 additions & 2 deletions wled00/data/settings_wifi.htm
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
oE.setAttribute("id", `CS${o - 1}`);
oE.setAttribute("name", `CS${o - 1}`);
}
oE = gId(`CP${iti}`);
oE = gId(`CP${o}`);
if (oE) {
oE.setAttribute("id", `CP${o - 1}`);
oE.setAttribute("name", `CP${o - 1}`);
Expand Down Expand Up @@ -232,14 +232,41 @@
}
U();
}
function PreS() {
for (let i = 0; i < wCount; i++) {
let oE = gId(`CS${i}`);
if (!oE || !oE.value || oE.value.trim().length == 0) {
oE.remove();
if (oE) oE.remove();
oE = gId(`CP${i}`);
if (oE) oE.remove();
oE = gId(`CR${i}`);
if (oE) oE.remove();

for (let o = i + 1; o < wCount; o++) {
oE = gId(`CS${o}`);
if (oE) {
oE.setAttribute("id", `CS${o - 1}`);
oE.setAttribute("name", `CS${o - 1}`);
}
oE = gId(`CP${o}`);
if (oE) {
oE.setAttribute("id", `CP${o - 1}`);
oE.setAttribute("name", `CP${o - 1}`);
}
}
wCount--;
}
}
}
function getURL(path) {
return (loc ? locproto + "//" + locip : "") + path;
}
</script>
<style>@import url("style.css");</style>
</head>
<body onload="S()">
<form id="form_s" name="Sf" method="post">
<form id="form_s" name="Sf" method="post" onsubmit="PreS()">
<div class="toprow">
<div class="helpB"><button type="button" onclick="H()">?</button></div>
<button type="button" onclick="B()">Back</button><button type="submit">Save & Connect</button><hr>
Expand Down
Loading

0 comments on commit b1d8baf

Please sign in to comment.