From 644e6ce953b606c9d2c295f40a2e5ebe4f78c120 Mon Sep 17 00:00:00 2001 From: Manuel Kasper Date: Mon, 17 Feb 2025 17:45:18 +0100 Subject: [PATCH] Add query parameters for pre-defined (not) activated by filters --- src/components/MapFilterControl.vue | 11 +++++++++++ src/views/Map.vue | 6 +++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/components/MapFilterControl.vue b/src/components/MapFilterControl.vue index f0a0575..fa56edb 100644 --- a/src/components/MapFilterControl.vue +++ b/src/components/MapFilterControl.vue @@ -116,6 +116,17 @@ export default { } }, mounted () { + if (this.$route.query.activatedBy) { + this.clearFilter() + this.activatedByEnabled = true + this.activatedBy = this.$route.query.activatedBy + this.$router.replace({ path: this.$route.path }) + } else if (this.$route.query.notActivatedBy) { + this.clearFilter() + this.notActivatedByEnabled = true + this.notActivatedBy = this.$route.query.notActivatedBy + this.$router.replace({ path: this.$route.path }) + } this.updateFilter() }, watch: { diff --git a/src/views/Map.vue b/src/views/Map.vue index e7c9242..8064151 100644 --- a/src/views/Map.vue +++ b/src/views/Map.vue @@ -406,10 +406,10 @@ export default { if (this.summit && this.summit.code) { hash = '#/summits/' + this.summit.code } - let fullPath = url + hash - if (!this.leavingRoute && this.$router.currentRoute.fullPath !== fullPath) { + let path = url + hash + if (!this.leavingRoute && this.$router.currentRoute.path !== path) { this.lastSetUrl = url - this.$router.replace(fullPath) + this.$router.replace({ path, query: this.$router.currentRoute.query }) } } },