fix live photo not loading
This commit is contained in:
parent
043f5e27f2
commit
561bdf9a36
|
@ -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'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue