Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix live photo not loading

Abhinav561bdf9a3603
diff --git a/apps/photos/src/components/PhotoFrame.tsx b/apps/photos/src/components/PhotoFrame.tsx
index 5d9f2e47ad..3999882108 100644
--- a/apps/photos/src/components/PhotoFrame.tsx
+++ b/apps/photos/src/components/PhotoFrame.tsx
@@ -423,7 +423,7 @@ const PhotoFrame = ({
try {
await updateSrcURL(index, item.id, dummyImgSrcUrl);
addLogLine(
- `[${item.id}] calling invalidateCurrItems for src, source loaded :${item.isSourceLoaded}`
+ `[${item.id}] calling invalidateCurrItems for live photo imgSrc, source loaded :${item.isSourceLoaded}`
);
instance.invalidateCurrItems();
if ((instance as any).isOpen()) {
@@ -433,7 +433,7 @@ const PhotoFrame = ({
if (e.message !== CustomError.URL_ALREADY_SET) {
logError(
e,
- 'updating photoswipe after src url update failed'
+ 'updating photoswipe after for live photo imgSrc update failed'
);
}
}
@@ -453,7 +453,7 @@ const PhotoFrame = ({
true
);
addLogLine(
- `[${item.id}] calling invalidateCurrItems for src, source loaded :${item.isSourceLoaded}`
+ `[${item.id}] calling invalidateCurrItems for live photo complete, source loaded :${item.isSourceLoaded}`
);
instance.invalidateCurrItems();
if ((instance as any).isOpen()) {
@@ -463,7 +463,7 @@ const PhotoFrame = ({
if (e.message !== CustomError.URL_ALREADY_SET) {
logError(
e,
- 'updating photoswipe after src url update failed'
+ 'updating photoswipe for live photo complete update failed'
);
}
}
diff --git a/apps/photos/src/utils/photoFrame/index.ts b/apps/photos/src/utils/photoFrame/index.ts
index dc2d19d421..3863f4485e 100644
--- a/apps/photos/src/utils/photoFrame/index.ts
+++ b/apps/photos/src/utils/photoFrame/index.ts
@@ -73,7 +73,10 @@ export async function updateFileSrcProps(file: EnteFile, srcURLs: SourceURL) {
const { url, isRenderable } = srcURLs;
file.w = window.innerWidth;
file.h = window.innerHeight;
- file.isSourceLoaded = true;
+ file.isSourceLoaded =
+ file.metadata.fileType === FILE_TYPE.LIVE_PHOTO
+ ? srcURLs.type === 'livePhoto'
+ : true;
file.isConverted = !srcURLs.isOriginal;
file.conversionFailed = !srcURLs.isRenderable;
file.srcURLs = srcURLs;