fix live photo not loading

This commit is contained in:
Abhinav 2023-12-08 12:55:04 +05:30
parent 043f5e27f2
commit 561bdf9a36
2 changed files with 8 additions and 5 deletions

View file

@ -423,7 +423,7 @@ const PhotoFrame = ({
try { try {
await updateSrcURL(index, item.id, dummyImgSrcUrl); await updateSrcURL(index, item.id, dummyImgSrcUrl);
addLogLine( 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(); instance.invalidateCurrItems();
if ((instance as any).isOpen()) { if ((instance as any).isOpen()) {
@ -433,7 +433,7 @@ const PhotoFrame = ({
if (e.message !== CustomError.URL_ALREADY_SET) { if (e.message !== CustomError.URL_ALREADY_SET) {
logError( logError(
e, e,
'updating photoswipe after src url update failed' 'updating photoswipe after for live photo imgSrc update failed'
); );
} }
} }
@ -453,7 +453,7 @@ const PhotoFrame = ({
true true
); );
addLogLine( 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(); instance.invalidateCurrItems();
if ((instance as any).isOpen()) { if ((instance as any).isOpen()) {
@ -463,7 +463,7 @@ const PhotoFrame = ({
if (e.message !== CustomError.URL_ALREADY_SET) { if (e.message !== CustomError.URL_ALREADY_SET) {
logError( logError(
e, e,
'updating photoswipe after src url update failed' 'updating photoswipe for live photo complete update failed'
); );
} }
} }

View file

@ -73,7 +73,10 @@ export async function updateFileSrcProps(file: EnteFile, srcURLs: SourceURL) {
const { url, isRenderable } = srcURLs; const { url, isRenderable } = srcURLs;
file.w = window.innerWidth; file.w = window.innerWidth;
file.h = window.innerHeight; 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.isConverted = !srcURLs.isOriginal;
file.conversionFailed = !srcURLs.isRenderable; file.conversionFailed = !srcURLs.isRenderable;
file.srcURLs = srcURLs; file.srcURLs = srcURLs;