Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix(photoswipe):showing-old-file-post-updation

Aswin Asok94cfede92c05
diff --git a/desktop/changes/file-viewer-image-after-date-edit.md b/desktop/changes/file-viewer-image-after-date-edit.md
new file mode 100644
index 0000000000..cdd99848fd
--- /dev/null
+++ b/desktop/changes/file-viewer-image-after-date-edit.md
@@ -0,0 +1 @@
+- Fixed the photo viewer showing the wrong image after changing a photo's date.
diff --git a/web/packages/gallery/components/viewer/photoswipe-core.ts b/web/packages/gallery/components/viewer/photoswipe-core.ts
index 5f38098af4..f5fc87a6ae 100644
--- a/web/packages/gallery/components/viewer/photoswipe-core.ts
+++ b/web/packages/gallery/components/viewer/photoswipe-core.ts
@@ -201,6 +201,9 @@ export class FileViewerPhotoSwipe<
const i = newIndex;
pswp.goTo(i);
+ // Rebind the annotation to the refreshed destination slide.
+ _currentAnnotatedFile = undefined;
+ pswp.refreshSlideContent(i);
pswp.refreshSlideContent(i == 0 ? newFileCount - 1 : i - 1);
pswp.refreshSlideContent(i + 1 == newFileCount ? 0 : i + 1);
}