fix nav error when current conditions data does not load

This commit is contained in:
Matt Walsh 2022-11-14 14:28:05 -06:00
parent e67774aa23
commit 20e0b1f1ac

View file

@ -178,7 +178,15 @@ const navigation = (() => {
progress.hideCanvas();
if (!current) {
// special case for no active displays (typically on progress screen)
displays[0].navNext(msg.command.firstFrame);
// find the first ready display
let firstDisplay;
let displayCount = 0;
do {
if (displays[displayCount].status === STATUS.loaded) firstDisplay = displays[displayCount];
displayCount += 1;
} while (!firstDisplay && displayCount < displays.length);
firstDisplay.navNext(msg.command.firstFrame);
return;
}
if (direction === msg.command.nextFrame) currentDisplay().navNext();