From f4101f06cc4f1fa551edf3a65e1626ea40906ead Mon Sep 17 00:00:00 2001 From: Matt Walsh Date: Wed, 21 Dec 2022 14:50:56 -0600 Subject: [PATCH] fix hazards failed to load auto play issue --- server/scripts/modules/navigation.mjs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/scripts/modules/navigation.mjs b/server/scripts/modules/navigation.mjs index 5f602e3..da6e3e0 100644 --- a/server/scripts/modules/navigation.mjs +++ b/server/scripts/modules/navigation.mjs @@ -109,6 +109,13 @@ const updateStatus = (value) => { // calculate first enabled display const firstDisplayIndex = displays.findIndex((display) => display.enabled && display.timing.totalScreens > 0); + // value.id = 0 is hazards, if they fail to load hot-wire a new value.id to the current display to see if it needs to be loaded + // typically this plays out as current conditions loads, then hazards fails. + if (value.id === 0 && (value.status === STATUS.failed || value.status === STATUS.retrying)) { + value.id = firstDisplayIndex; + value.status = displays[firstDisplayIndex].status; + } + // if this is the first display and we're playing, load it up so it starts playing if (isPlaying() && value.id === firstDisplayIndex && value.status === STATUS.loaded) { navTo(msg.command.firstFrame);