Skip to content

Commit e6dae68

Browse files
authored
Fix wifi-dialog (#1921)
As [discovered here](tiny-pilot/tinypilot-pro#1618 (comment)), we've broken the wifi-dialog via #1902. The issue is that we've previously changed the output of the `/api/network/status` endpoint to return a list of network interfaces, but we forgot to update the endpoint's usage in wifi-dialog. This PR fixes the usage of the `/api/network/status` endpoint in wifi-dialog. <a data-ca-tag href="https://codeapprove.com/pr/tiny-pilot/tinypilot/1921"><img src="https://codeapprove.com/external/github-tag-allbg.png" alt="Review on CodeApprove" /></a>
1 parent 627835a commit e6dae68

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/templates/custom-elements/wifi-dialog.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,13 @@ <h3>Wi-Fi Credentials Removed</h3>
289289
wifiSettings.countryCode || "US";
290290
this._elements.pskInput.value = "";
291291
this._initialWiFiSettings = { psk: "", ...wifiSettings };
292-
292+
// Show ethernet warning when no ethernet interfaces are connected.
293293
this._elements.noEthernetWarning.hide();
294294
this._elements.inputError.hide();
295-
if (!networkStatus.ethernet.isConnected) {
295+
const noEthernetConnected = networkStatus
296+
.filter((iface) => iface.name.startsWith("eth"))
297+
.every((iface) => !iface.isConnected);
298+
if (noEthernetConnected) {
296299
this._elements.noEthernetWarning.show();
297300
}
298301

0 commit comments

Comments
 (0)