Merge branch 'develop'

This commit is contained in:
vabene1111
2025-09-19 16:20:56 +02:00
2 changed files with 15 additions and 3 deletions

View File

@@ -156,14 +156,18 @@ const router = useRouter()
const isPrintMode = useMediaQuery('print')
onMounted(() => {
useUserPreferenceStore().init()
useUserPreferenceStore().init().then(() => {
if (useUserPreferenceStore().activeSpace.spaceSetupCompleted != undefined && !useUserPreferenceStore().activeSpace.spaceSetupCompleted) {
router.push({name: 'WelcomePage'})
}
})
})
/**
* global title update handler, might be overridden by page specific handlers
*/
router.afterEach((to, from) => {
if(to.name == 'StartPage' && !useUserPreferenceStore().activeSpace.spaceSetupCompleted != undefined &&!useUserPreferenceStore().activeSpace.spaceSetupCompleted && useUserPreferenceStore().activeSpace.createdBy.id! == useUserPreferenceStore().userSettings.user.id!){
if(to.name == 'StartPage' && useUserPreferenceStore().initCompleted && !useUserPreferenceStore().activeSpace.spaceSetupCompleted != undefined &&!useUserPreferenceStore().activeSpace.spaceSetupCompleted && useUserPreferenceStore().activeSpace.createdBy.id! == useUserPreferenceStore().userSettings.user.id!){
router.push({name: 'WelcomePage'})
}
nextTick(() => {

View File

@@ -45,6 +45,11 @@ export const useUserPreferenceStore = defineStore('user_preference_store', () =>
*/
let isAuthenticated = ref(false)
/**
* complete refresh of all data from server completed
*/
const initCompleted = ref(false)
const theme = useTheme()
const router = useRouter()
@@ -233,7 +238,9 @@ export const useUserPreferenceStore = defineStore('user_preference_store', () =>
promises.push(loadSpaces())
updateTheme()
return Promise.allSettled(promises)
return Promise.allSettled(promises).then(() => {
initCompleted.value = true
})
}
return {
@@ -246,6 +253,7 @@ export const useUserPreferenceStore = defineStore('user_preference_store', () =>
spaces,
activeUserSpace,
isAuthenticated,
initCompleted,
loadUserSettings,
loadServerSettings,
updateUserSettings,