From d15f30307a25d6b611f930327247990127f4cdc7 Mon Sep 17 00:00:00 2001
From: ManikanthDindigala <dindigala@sub.uni-goettingen.de>
Date: Fri, 6 Aug 2021 12:13:55 +0200
Subject: [PATCH] fix: update route path condition.

---
 src/.vuepress/components/Bar.vue | 4 +++-
 src/.vuepress/components/Cta.vue | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/.vuepress/components/Bar.vue b/src/.vuepress/components/Bar.vue
index e82a769..d0ffdbe 100644
--- a/src/.vuepress/components/Bar.vue
+++ b/src/.vuepress/components/Bar.vue
@@ -93,7 +93,9 @@ export default {
   }),
   computed: {
     getPath(){
-      return window?.location?.origin + window?.location?.pathname;
+      // we need this condition check because of computed reactive property.
+      // this.$route.path changes everytime we navigate between pages, so get path will always get's updated.
+      return window?.location?.origin + (window?.location?.pathname !== this.$route.path ? window?.location?.pathname : this.$route.path);
     }
   }
 }
diff --git a/src/.vuepress/components/Cta.vue b/src/.vuepress/components/Cta.vue
index 63e6c23..e11a578 100755
--- a/src/.vuepress/components/Cta.vue
+++ b/src/.vuepress/components/Cta.vue
@@ -48,7 +48,9 @@ export default {
   }),
   computed: {
     getPath(){
-      return window?.location?.origin + window?.location?.pathname;
+      // we need this condition check because of computed reactive property.
+      // this.$route.path changes everytime we navigate between pages, so get path will always get's updated.
+      return window?.location?.origin + (window?.location?.pathname !== this.$route.path ? window?.location?.pathname : this.$route.path);
     }
   }
 }
-- 
GitLab