From c5cc492f0ab1de3143c4bf97a6e4948dfe32a7ef Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Fri, 1 Aug 2025 18:45:21 +0200 Subject: [PATCH] navigate to start page when space is switched --- vue3/src/stores/UserPreferenceStore.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vue3/src/stores/UserPreferenceStore.ts b/vue3/src/stores/UserPreferenceStore.ts index ebeecadb2..397747d12 100644 --- a/vue3/src/stores/UserPreferenceStore.ts +++ b/vue3/src/stores/UserPreferenceStore.ts @@ -6,6 +6,7 @@ import {ShoppingGroupingOptions} from "@/types/Shopping"; import {computed, ComputedRef, ref} from "vue"; import {DeviceSettings} from "@/types/settings"; import {useTheme} from "vuetify"; +import {useRouter} from "vue-router"; const DEVICE_SETTINGS_KEY = 'TANDOOR_DEVICE_SETTINGS' const USER_PREFERENCE_KEY = 'TANDOOR_USER_PREFERENCE' @@ -44,7 +45,8 @@ export const useUserPreferenceStore = defineStore('user_preference_store', () => */ let isAuthenticated = ref(false) - let theme = useTheme() + const theme = useTheme() + const router = useRouter() /** * holds the active user space if there is one or null if not @@ -159,7 +161,9 @@ export const useUserPreferenceStore = defineStore('user_preference_store', () => api.apiSwitchActiveSpaceRetrieve({spaceId: space.id!}).then(r => { loadActiveSpace() - location.reload() + router.push({name: 'StartPage'}).then(() => { + location.reload() + }) }).catch(err => { useMessageStore().addError(ErrorMessageType.FETCH_ERROR, err) })