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({