Skip to content

armgit / ente

Public Imported from GitHub
0

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

[web] Ensure copy as PNG option is reset when we get the original

Manav Rathi883b14e96a4e
diff --git a/web/packages/gallery/components/viewer/photoswipe.ts b/web/packages/gallery/components/viewer/photoswipe.ts
index 69468e8484..971be1f046 100644
--- a/web/packages/gallery/components/viewer/photoswipe.ts
+++ b/web/packages/gallery/components/viewer/photoswipe.ts
@@ -315,9 +315,13 @@ export class FileViewerPhotoSwipe {
const videoQuality = intendedVideoQualityForFileID(file.id);
- const itemData = itemDataForFile(file, { videoQuality }, () =>
- pswp.refreshSlideContent(index),
- );
+ const itemData = itemDataForFile(file, { videoQuality }, () => {
+ // When we get updated item data,
+ // 1. Clear cached data.
+ _currentAnnotatedFile = undefined;
+ // 2. Request a refresh.
+ pswp.refreshSlideContent(index);
+ });
if (itemData.fileType === FileType.video) {
const { videoPlaylistURL, videoURL } = itemData;