Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

debug

Manav Rathi5e73257b71cc
diff --git a/web/apps/cast/src/components/Slide.tsx b/web/apps/cast/src/components/Slide.tsx
index 8309f8bc2c..4df36c4c1d 100644
--- a/web/apps/cast/src/components/Slide.tsx
+++ b/web/apps/cast/src/components/Slide.tsx
@@ -11,7 +11,7 @@ interface SlideViewProps {
* Also show {@link nextURL} in an hidden image view to prepare the browser for
* an imminent transition to it.
*/
-export const SlideView: React.FC<SlideViewProps> = ({ url, nextURL }) => {
+export const SlideView: React.FC<SlideViewProps> = ({ url }) => {
return (
<div
style={{
@@ -35,14 +35,14 @@ export const SlideView: React.FC<SlideViewProps> = ({ url, nextURL }) => {
backdropFilter: "blur(10px)",
}}
>
- <img
+ {/* <img
src={nextURL}
style={{
maxWidth: "100%",
maxHeight: "100%",
display: "none",
}}
- />
+ /> */}
<img
src={url}
style={{
diff --git a/web/apps/cast/src/services/cast.ts b/web/apps/cast/src/services/cast.ts
index 8cb99c2416..a33c749f51 100644
--- a/web/apps/cast/src/services/cast.ts
+++ b/web/apps/cast/src/services/cast.ts
@@ -120,6 +120,7 @@ export const renderableImageURLs = async function* (castData: CastData) {
if (!isFileEligibleForCast(file)) continue;
+ console.log("will start createRenderableURL", new Date());
try {
urls.push(await createRenderableURL(castToken, file));
haveEligibleFiles = true;
@@ -128,6 +129,8 @@ export const renderableImageURLs = async function* (castData: CastData) {
continue;
}
+ console.log("did end createRenderableURL", new Date());
+
// Need at least a pair.
//
// There are two scenarios:
@@ -137,7 +140,7 @@ export const renderableImageURLs = async function* (castData: CastData) {
// - Subsequently, urls will have the "next" / "preloaded" URL left
// over from the last time. We'll promote that to being the one
// that'll get displayed, and preload another one.
- if (urls.length < 2) continue;
+ // if (urls.length < 2) continue;
// The last element of previousURLs is the URL that is currently
// being shown on screen.
@@ -150,15 +153,17 @@ export const renderableImageURLs = async function* (castData: CastData) {
// The URL that'll now get displayed on screen.
const url = ensure(urls.shift());
// The URL that we're preloading for next time around.
- const nextURL = ensure(urls[0]);
+ const nextURL = ""; //ensure(urls[0]);
previousURLs.push(url);
const urlPair: RenderableImageURLPair = [url, nextURL];
const elapsedTime = Date.now() - lastYieldTime;
- if (elapsedTime > 0 && elapsedTime < slideDuration)
+ if (elapsedTime > 0 && elapsedTime < slideDuration) {
+ console.log("waiting", slideDuration - elapsedTime);
await wait(slideDuration - elapsedTime);
+ }
lastYieldTime = Date.now();
yield urlPair;