Skip to content

Commit

Permalink
Testing interruptability in production.
Browse files Browse the repository at this point in the history
  • Loading branch information
LutherTS committed Sep 13, 2024
1 parent 0bc2e6b commit 95f4b81
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions app/(pages)/carousel-part-cleaned/carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,17 @@ export default function Carousel({ images }: { images: string[] }) {
let objectFittingScrollHeight = useMotionValue(height);

useEffect(() => {
const image = document.getElementById(
`${IMAGEID + index}`,
) as HTMLImageElement;
const imageDecoding = async () => await image.decode();
imageDecoding().then(() => {
objectFittingScrollHeight.set(
document.getElementById(`${IMAGEID + index}`)!.clientHeight,
);
});
if (objectFitting === "scroll") {
const image = document.getElementById(
`${IMAGEID + index}`,
) as HTMLImageElement;
const imageDecoding = async () => await image.decode();
imageDecoding().then(() => {
objectFittingScrollHeight.set(
document.getElementById(`${IMAGEID + index}`)!.clientHeight,
);
});
}
}, [index, objectFitting, width, images]);

/* NEXT UP WOULD BE:
Expand Down

0 comments on commit 95f4b81

Please sign in to comment.