mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-14 15:49:31 -07:00
fix hazards displaying when disabled (sometimes) close #140
This commit is contained in:
@@ -103,7 +103,10 @@ class Hazards extends WeatherDisplay {
|
|||||||
// show alert indicator
|
// show alert indicator
|
||||||
if (unViewed > 0) alert.classList.add('show');
|
if (unViewed > 0) alert.classList.add('show');
|
||||||
// draw the canvas to calculate the new timings and activate hazards in the slide deck again
|
// draw the canvas to calculate the new timings and activate hazards in the slide deck again
|
||||||
this.drawLongCanvas();
|
// unless this has been disabled
|
||||||
|
if (this.isEnabled) {
|
||||||
|
this.drawLongCanvas();
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`Unexpected Active Alerts error: ${error.message}`);
|
console.error(`Unexpected Active Alerts error: ${error.message}`);
|
||||||
if (this.isEnabled) this.setStatus(STATUS.failed);
|
if (this.isEnabled) this.setStatus(STATUS.failed);
|
||||||
@@ -115,7 +118,7 @@ class Hazards extends WeatherDisplay {
|
|||||||
this.getDataCallback();
|
this.getDataCallback();
|
||||||
|
|
||||||
if (!superResult) {
|
if (!superResult) {
|
||||||
this.setStatus(STATUS.loaded);
|
// Don't override status - super.getData() already set it to STATUS.disabled
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.drawLongCanvas();
|
this.drawLongCanvas();
|
||||||
|
|||||||
Reference in New Issue
Block a user