[web][cast] Add slide logs (#1566)

## Description

## Tests
This commit is contained in:
Neeraj Gupta 2024-04-30 17:47:08 +05:30 committed by GitHub
commit 262e8852de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -103,13 +103,26 @@ export default function Slideshow() {
const showNextSlide = async () => {
try {
console.log("showNextSlide");
const currentIndex = collectionFiles.findIndex(
(file) => file.id === currentFileId,
);
console.log(
"showNextSlide-index",
currentIndex,
collectionFiles.length,
);
const nextIndex = (currentIndex + 1) % collectionFiles.length;
const nextNextIndex = (nextIndex + 1) % collectionFiles.length;
console.log(
"showNextSlide-nextIndex and nextNextIndex",
nextIndex,
nextNextIndex,
);
const nextFile = collectionFiles[nextIndex];
const nextNextFile = collectionFiles[nextNextIndex];