Fix Tricolour stage images

This commit is contained in:
Samuel Elliott
2022-11-13 01:04:27 +00:00
parent c536ff00f2
commit ca8377a739

View File

@@ -43,12 +43,20 @@ function defineSplatfestRegionStore(region) {
// TODO: Eventually this needs to be handled on a per-region basis.
const tricolor = computed(() => {
let fest = useSchedulesDataStore().data?.currentFest;
let {currentFest: fest, vsStages} = useSchedulesDataStore().data ?? {};
if (!fest) {
return null;
}
// Move the thumbnail image to "thumbnailImage" and pull in the high-res image for the stage
if (!('thumbnailImage' in fest.tricolorStage)) {
fest.tricolorStage.thumbnailImage = fest.tricolorStage.image;
fest.tricolorStage.image =
vsStages.nodes.find(s => s.id === fest.tricolorStage.id)?.originalImage ||
fest.tricolorStage.image;
}
return {
...fest,
isTricolorActive: time.isActive(fest.midtermTime, fest.endTime),