From 1732a3381f2259694449c3645cab31d24b3b52f2 Mon Sep 17 00:00:00 2001 From: Matt Walsh Date: Tue, 9 Sep 2025 19:36:23 -0500 Subject: [PATCH] fix hazards displaying when disabled (sometimes) close #140 --- server/scripts/modules/hazards.mjs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/scripts/modules/hazards.mjs b/server/scripts/modules/hazards.mjs index 4010fa3..28553ab 100644 --- a/server/scripts/modules/hazards.mjs +++ b/server/scripts/modules/hazards.mjs @@ -103,7 +103,10 @@ class Hazards extends WeatherDisplay { // show alert indicator if (unViewed > 0) alert.classList.add('show'); // 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) { console.error(`Unexpected Active Alerts error: ${error.message}`); if (this.isEnabled) this.setStatus(STATUS.failed); @@ -115,7 +118,7 @@ class Hazards extends WeatherDisplay { this.getDataCallback(); if (!superResult) { - this.setStatus(STATUS.loaded); + // Don't override status - super.getData() already set it to STATUS.disabled return; } this.drawLongCanvas();