From a0b2bb32063d1cadebc2bb06c88ae1e0686b7e07 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Mon, 7 Nov 2022 05:24:17 -0800 Subject: [PATCH] viewer: fix router pop on close --- src/components/Viewer.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/Viewer.vue b/src/components/Viewer.vue index 978c46de..dfdc3e83 100644 --- a/src/components/Viewer.vue +++ b/src/components/Viewer.vue @@ -600,6 +600,10 @@ export default class Viewer extends Mixins(GlobalMixin) { /** Set the route hash to the given photo */ private setRouteHash(photo: IPhoto | undefined) { + if (!photo && !this.isOpen) { + return this.$router.back(); + } + const hash = photo ? utils.getViewerHash(photo) : ""; if (hash !== this.$route.hash) { this.$router.replace({