Commit 443ae8a4 authored by Magnus Westergaard's avatar Magnus Westergaard
Browse files

DEICH-5891: Fix info screen data bug.

parent d670cc67
......@@ -72,18 +72,20 @@ export default function PresentationScreen({ librarySlug, screenId }) {
useEffect(
() => {
if (dataSyncRef.current) {
clearInterval(dataSyncRef.current);
if (library) {
if (dataSyncRef.current) {
clearInterval(dataSyncRef.current);
}
loadLibraryData(dispatch, library);
// Set timer for fetching of new data (background fetch)
dataSyncRef.current = setInterval(
() => loadLibraryData(dispatch, library),
DATA_SYNC_INTERVAL
);
return () => {
clearInterval(dataSyncRef.current);
};
}
loadLibraryData(dispatch, library);
// Set timer for fetching of new data (background fetch)
dataSyncRef.current = setInterval(
() => loadLibraryData(dispatch, library),
DATA_SYNC_INTERVAL
);
return () => {
clearInterval(dataSyncRef.current);
};
},
[library]
);
......
......@@ -50,7 +50,7 @@ const SlideComponent = ({ type, ...props }) => {
};
const SlideShow = ({ size, animation, data, showHeader, showFooter }) => {
const { slides = [], currentFloorLevel } = data;
const { slides = [], currentFloorLevel, openingHours } = data;
// Return nothing if no slides
......@@ -99,6 +99,7 @@ const SlideShow = ({ size, animation, data, showHeader, showFooter }) => {
currentSlideTheme={currentSlideTheme}
showHeader={showHeader}
size={size}
openingHours={openingHours}
/>
);
};
......@@ -132,7 +133,8 @@ function SlideShowAnimator({
showFooter,
currentSlideShowFooter,
size,
currentFloorLevel
currentFloorLevel,
openingHours
}) {
const slideAnimation = ANIMATIONS[animation];
const transition = useTransition(slideToRender, slideAnimation);
......@@ -164,7 +166,7 @@ function SlideShowAnimator({
{showFooter && currentSlideShowFooter && (
<OsloKommuneLogo
openingHoursToday={data.openingHours}
openingHoursToday={openingHours}
theme={currentSlideTheme}
/>
)}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment