Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Added initializing state tracking (#5219)

christof-wittreichb455b9f4c0ff
diff --git a/web/js/components/tour/joyride-wrapper.js b/web/js/components/tour/joyride-wrapper.js
index 997cf0acc..600756fd1 100644
--- a/web/js/components/tour/joyride-wrapper.js
+++ b/web/js/components/tour/joyride-wrapper.js
@@ -51,6 +51,7 @@ export default function JoyrideWrapper ({
const [elementPositionKey, setElementPositionKey] = useState(key);
const [stepIndex, setStepIndex] = useState();
const [run, setRun] = useState(false);
+ const [isInitializing, setIsInitializing] = useState(true);
const incrementKey = () => {
key += 1;
@@ -144,6 +145,7 @@ export default function JoyrideWrapper ({
setPlaceholderLocation(placeholderEl, targetCoordinates);
}
});
+ setIsInitializing(false);
// Force a re-render so that Joyride updates the beacon location,
// otherwise it doesn't know the DOM element position was updated
incrementKey();
@@ -215,7 +217,7 @@ export default function JoyrideWrapper ({
}
});
- return !projMatches ? null : (
+ return !projMatches || isInitializing ? null : (
<Joyride
run={run}
stepIndex={stepIndex}