Self-hosted personal gallery application with online photo management and albums, supporting Live/Motion Photos, EXIF parsing, geolocation recognition, and an explore map.
TypeScript albumsexif-extractiongeocodinglive-photomotion-photophoto-galleryphoto-sharingwebgl-viewer
fix(gallery): restore source photo on external viewer close
Timothy Yinf0d679dae81f
diff --git a/packages/gallery/app/components/photo/Viewer.vue b/packages/gallery/app/components/photo/Viewer.vueindex 034072da..fa00fe7f 100644--- a/packages/gallery/app/components/photo/Viewer.vue+++ b/packages/gallery/app/components/photo/Viewer.vue@@ -96,6 +96,7 @@ const { convertMovToMp4, getProcessingState } = useLivePhotoProcessor()const currentPhoto = computed(() => props.photos[props.currentIndex])const isTransitioning = ref(false)let isOpening = false+let isClosing = falselet closeQueued = falselet transitionImage: HTMLImageElement | undefinedlet transitionAnimation: Animation | undefined@@ -206,6 +207,7 @@ const requestClose = async () => {return}if (isTransitioning.value) return+ isClosing = truelet closed = falseconst close = () => {if (closed) return@@ -218,6 +220,7 @@ const requestClose = async () => {close()restoreSourceVisibility?.()restoreSourceVisibility = undefined+ isClosing = false}}@@ -226,6 +229,11 @@ watch(async (open) => {if (!open) {closeQueued = false+ if (!isClosing) {+ transitionAnimation?.cancel()+ restoreSourceVisibility?.()+ restoreSourceVisibility = undefined+ }return}isOpening = true