π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
fix-lint
Aswin Asok1a4948a2fb37
diff --git a/web/apps/memories/src/components/PublicMemoryMedia.tsx b/web/apps/memories/src/components/PublicMemoryMedia.tsxindex cd514cdd5e..5c7a3e73b3 100644--- a/web/apps/memories/src/components/PublicMemoryMedia.tsx+++ b/web/apps/memories/src/components/PublicMemoryMedia.tsx@@ -129,6 +129,7 @@ export function PhotoImage({const onAspectRatioRef = useRef(onAspectRatio);const mediaReadyRef = useRef(false);const thumbnailResolvedRef = useRef(false);+ const fullImageLoadTokenRef = useRef<symbol | null>(null);const hasNotifiedDisplayReadyRef = useRef(false);const hasNotifiedThumbnailResolvedRef = useRef(false);const lastReportedAspectRatioRef = useRef<number | undefined>(undefined);@@ -251,13 +252,16 @@ export function PhotoImage({return;}- let cancelled = false;+ const loadToken = Symbol("full-image-load");+ fullImageLoadTokenRef.current = loadToken;++ const isStaleLoad = () => fullImageLoadTokenRef.current !== loadToken;const loadFullImage = async () => {try {const sourceURLs =await downloadManager.renderableSourceURLs(file);- if (cancelled) {+ if (isStaleLoad()) {return;}if (sourceURLs.type === "video") {@@ -268,7 +272,7 @@ export function PhotoImage({let nextFullImageURL: string;if (sourceURLs.type === "livePhoto") {nextFullImageURL = await sourceURLs.imageURL();- if (cancelled) {+ if (isStaleLoad()) {return;}} else {@@ -278,7 +282,7 @@ export function PhotoImage({setFullImageURL(nextFullImageURL);} catch (error) {log.error("Failed to load full image", error);- if (!cancelled) {+ if (!isStaleLoad()) {signalReady();}}@@ -287,7 +291,9 @@ export function PhotoImage({void loadFullImage();return () => {- cancelled = true;+ if (fullImageLoadTokenRef.current === loadToken) {+ fullImageLoadTokenRef.current = null;+ }};}, [enableFullLoad, file, signalReady, thumbnailOnly]);