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
…1422)

(cherry picked from commit 585d514)
  • Loading branch information
awahab07 committed Sep 22, 2022
1 parent 9e8d668 commit fcb6e9f
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 fcb6e9f

Please sign in to comment.