From a1d6f260cf97880f89e2216cea5611df6bf8a7fb Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Mon, 25 Nov 2024 19:43:05 +0530 Subject: [PATCH] Reuse --- web/apps/photos/src/components/PhotoFrame.tsx | 29 +++++-------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/web/apps/photos/src/components/PhotoFrame.tsx b/web/apps/photos/src/components/PhotoFrame.tsx index 24eee08f5e..ff54d84129 100644 --- a/web/apps/photos/src/components/PhotoFrame.tsx +++ b/web/apps/photos/src/components/PhotoFrame.tsx @@ -410,28 +410,13 @@ const PhotoFrame = ({ url: { video: videoURL, image: imageURL }, type: "livePhoto", }; - try { - const updated = updateSourceURL( - index, - item.id, - loadedLivePhotoSrcURL, - true, - ); - if (updated) { - log.info( - `[${item.id}] calling invalidateCurrItems for live photo complete, source loaded: ${item.isSourceLoaded}`, - ); - instance.invalidateCurrItems(); - if ((instance as any).isOpen()) { - instance.updateSize(true); - } - } - } catch (e) { - log.error( - "updating photoswipe for live photo complete update failed", - e, - ); - } + updateSource( + instance, + index, + item, + loadedLivePhotoSrcURL, + true, + ); } else { updateSource(instance, index, item, srcURLs, false); }