mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-16 00:29:34 -07:00
Merge branch 'main' of github.com:netbymatt/ws4kp
This commit is contained in:
@@ -35,7 +35,8 @@ class Hazards extends WeatherDisplay {
|
||||
const alerts = await json(url, { retryCount: 3, stillWaiting: () => this.stillWaiting() });
|
||||
const unsortedAlerts = alerts.features ?? [];
|
||||
const sortedAlerts = unsortedAlerts.sort((a, b) => (hazardLevels[b.properties.severity] ?? 0) - (hazardLevels[a.properties.severity] ?? 0));
|
||||
this.data = sortedAlerts;
|
||||
const filteredAlerts = sortedAlerts.filter((hazard) => hazard.properties.severity !== 'Unknown');
|
||||
this.data = filteredAlerts;
|
||||
|
||||
// show alert indicator
|
||||
if (this.data.length > 0) alert.classList.add('show');
|
||||
@@ -76,6 +77,7 @@ class Hazards extends WeatherDisplay {
|
||||
if (lines.length === 0) {
|
||||
this.setStatus(STATUS.loaded);
|
||||
this.timing.totalScreens = 0;
|
||||
this.setStatus(STATUS.loaded);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user