Update samy.js

This commit is contained in:
2025-12-17 20:12:42 -05:00
parent bc0222aa50
commit c72e20e99f

View File

@@ -240,6 +240,14 @@ async function fetchSites() {
if (!resp.ok) throw "HTTP " + resp.status; if (!resp.ok) throw "HTTP " + resp.status;
const sites = await resp.json(); const sites = await resp.json();
if (!Array.isArray(sites) || sites.length === 0) {
dropdown.innerHTML =
'<option disabled selected>No sites returned</option>';
alert("No Datto sites returned. Verify credentials/allowlist, or try again in a moment.");
return;
}
dropdown.innerHTML = ""; dropdown.innerHTML = "";
sites.forEach((site) => { sites.forEach((site) => {