From b2aca1ee8d043c9415e677b490f158a24e0aa346 Mon Sep 17 00:00:00 2001 From: Matt Walsh Date: Mon, 12 Dec 2022 14:01:10 -0600 Subject: [PATCH] fix auto-start when first display is disabled --- server/scripts/modules/navigation.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/scripts/modules/navigation.mjs b/server/scripts/modules/navigation.mjs index 0895b05..877d604 100644 --- a/server/scripts/modules/navigation.mjs +++ b/server/scripts/modules/navigation.mjs @@ -100,8 +100,11 @@ const updateStatus = (value) => { if (!progress) return; progress.drawCanvas(displays, countLoadedDisplays()); + // calculate first enabled display + const firstDisplayIndex = displays.findIndex((display) => display.enabled); + // if this is the first display and we're playing, load it up so it starts playing - if (isPlaying() && value.id === 0 && value.status === STATUS.loaded) { + if (isPlaying() && value.id === firstDisplayIndex && value.status === STATUS.loaded) { navTo(msg.command.firstFrame); }