diff --git a/app/public/dashboard.html b/app/public/dashboard.html index edc0783..e977ff6 100644 --- a/app/public/dashboard.html +++ b/app/public/dashboard.html @@ -1334,6 +1334,11 @@ async function loadAlerts() { const r = await fetch('/api/dashboard/alerts'); if (!r.ok) return; const data = await r.json(); + if (data.noLocation) { + section.style.marginBottom = '1rem'; + section.innerHTML = '
⚠ No location set — add your coordinates in Settings to see NWS alerts.
'; + return; + } const features = data.features || []; if (!features.length) { section.innerHTML = ''; section.style.marginBottom = '0'; return; } section.style.marginBottom = '1rem'; diff --git a/app/server.js b/app/server.js index c0b2f71..303ce09 100644 --- a/app/server.js +++ b/app/server.js @@ -1344,6 +1344,7 @@ app.post('/api/dashboard/location', requireDashboardAuth, (req, res) => { return res.status(400).json({ error: 'Invalid coordinates' }); dashAuth = { ...dashAuth, stationLat: +lat, stationLon: +lon }; try { fs.writeFileSync(DASH_AUTH_FILE, JSON.stringify(dashAuth)); } catch {} + dashAlertCache.clear(); res.json({ ok: true }); });