Skip to content

Commit

Permalink
Fix Next and Previous button on step screenshot carousel. (elastic#14…
Browse files Browse the repository at this point in the history
  • Loading branch information
awahab07 authored Sep 22, 2022
1 parent 37d6b9d commit 585d514
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,11 @@ export const PingTimestamp = ({

const [screenshotRef, setScreenshotRef] = useState<ScreenshotRefImageData | undefined>(undefined);

const isScreenshotRefValid = Boolean(
screenshotRef && screenshotRef?.ref?.screenshotRef?.synthetics?.step?.index === stepNumber
);
const { data, loading } = useInProgressImage({
hasImage: Boolean(stepImages[stepNumber - 1]) || Boolean(screenshotRef),
hasImage: Boolean(stepImages[stepNumber - 1]) || isScreenshotRefValid,
hasIntersected: Boolean(intersection && intersection.intersectionRatio === 1),
stepStatus,
imgPath,
Expand Down

0 comments on commit 585d514

Please sign in to comment.