commit
f7a62c91e9
3 changed files with 22 additions and 2 deletions
|
@ -11,14 +11,16 @@ export const PhotoAuditorium: React.FC<PhotoAuditoriumProps> = ({
|
|||
showNextSlide,
|
||||
}) => {
|
||||
useEffect(() => {
|
||||
console.log("showing slide");
|
||||
const timeoutId = window.setTimeout(() => {
|
||||
console.log("showing next slide timer");
|
||||
showNextSlide();
|
||||
}, 10000);
|
||||
|
||||
return () => {
|
||||
if (timeoutId) clearTimeout(timeoutId);
|
||||
};
|
||||
}, [showNextSlide]);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div
|
||||
|
|
|
@ -174,12 +174,18 @@ export default function PairingMode() {
|
|||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
console.log("useEffect for pairing called");
|
||||
if (digits.length < 1 || !publicKeyB64 || !privateKeyB64) return;
|
||||
|
||||
const interval = setInterval(async () => {
|
||||
console.log("polling for cast data");
|
||||
const data = await pollForCastData();
|
||||
if (!data) return;
|
||||
if (!data) {
|
||||
console.log("no data");
|
||||
return;
|
||||
}
|
||||
storeCastData(data);
|
||||
console.log("pushing slideshow");
|
||||
await router.push("/slideshow");
|
||||
}, 1000);
|
||||
|
||||
|
|
|
@ -131,29 +131,41 @@ export default function Slideshow() {
|
|||
|
||||
if (!nextURL) {
|
||||
try {
|
||||
console.log("nextURL doesn't exist yet");
|
||||
const blob = await getPreviewableImage(nextFile, castToken);
|
||||
console.log("nextURL blobread");
|
||||
const url = URL.createObjectURL(blob);
|
||||
console.log("nextURL", url);
|
||||
renderableFileURLCache.set(nextFile.id, url);
|
||||
console.log("nextUrlCache set");
|
||||
nextURL = url;
|
||||
} catch (e) {
|
||||
console.log("error in nextUrl", e);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
console.log("nextURL already exists");
|
||||
}
|
||||
|
||||
if (!nextNextURL) {
|
||||
try {
|
||||
console.log("nextNextURL doesn't exist yet");
|
||||
const blob = await getPreviewableImage(
|
||||
nextNextFile,
|
||||
castToken,
|
||||
);
|
||||
console.log("nextNextURL blobread");
|
||||
const url = URL.createObjectURL(blob);
|
||||
console.log("nextNextURL", url);
|
||||
renderableFileURLCache.set(nextNextFile.id, url);
|
||||
console.log("nextNextURCacheL set");
|
||||
nextNextURL = url;
|
||||
} catch (e) {
|
||||
console.log("error in nextNextURL", e);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
console.log("nextNextURL already exists");
|
||||
}
|
||||
|
||||
setLoading(false);
|
||||
|
|
Loading…
Add table
Reference in a new issue