From bf256574c98cedadd27fb099da8e4c3e20953eae Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 3 Aug 2023 09:41:26 +0200 Subject: [PATCH] refs #5989 getUrl --- src/components/NavBar.vue | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue index d59a8b3fc..561197a18 100644 --- a/src/components/NavBar.vue +++ b/src/components/NavBar.vue @@ -6,6 +6,7 @@ import UserPanel from 'components/UserPanel.vue'; import { useState } from 'src/composables/useState'; import { useStateStore } from 'stores/useStateStore'; import PinnedModules from './PinnedModules.vue'; +import { getUrl } from 'src/composables/getUrl'; const { t } = useI18n(); const session = useSession(); @@ -13,23 +14,21 @@ const stateStore = useStateStore(); const state = useState(); const user = state.getUser(); const token = session.getToken(); -const appName = 'Lilium'; onMounted(() => stateStore.setMounted()); -function redirect(id) { +function redirect() { const currentURL = window.location.href; - const salixBaseURL = 'https://salix.verdnatura.es/#!/'; const routeRegex = /\/#\/(\w+)(?:\/(\d+))?/; const match = currentURL.match(routeRegex); if (match) { const [, element, number] = match; const redirectURL = - salixBaseURL + (number ? `${element}/${number}/summary` : `${element}/index`); + getUrl() + (number ? `${element}/${number}/summary` : `${element}/index`); window.location.href = redirectURL; } else { - window.location.href = salixBaseURL; + window.location.href = getUrl(); } }