Skip to content

Commit

Permalink
fix: don't wait for spaces if context is anonymous
Browse files Browse the repository at this point in the history
  • Loading branch information
kulmann committed Nov 2, 2022
1 parent a501b04 commit b27bc11
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions packages/web-runtime/src/layouts/Application.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div id="web-content-main" class="oc-px-s oc-pb-s">
<div class="app-container oc-flex">
<sidebar-nav v-if="isSidebarVisible" class="app-navigation" :nav-items="sidebarNavItems" />
<app-loading-spinner v-if="areSpacesLoading" />
<app-loading-spinner v-if="isLoading" />
<template v-else>
<router-view
v-for="name in ['default', 'app', 'fullscreen']"
Expand Down Expand Up @@ -37,11 +37,12 @@ import UploadInfo from '../components/UploadInfo.vue'
import {
useActiveApp,
useRoute,
useRouteMeta,
useSpacesLoading,
useStore,
useUserContext
} from 'web-pkg/src/composables'
import { watch, defineComponent } from '@vue/composition-api'
import { computed, defineComponent, unref, watch } from '@vue/composition-api'
export default defineComponent({
name: 'ApplicationLayout',
Expand Down Expand Up @@ -73,8 +74,17 @@ export default defineComponent({
},
{ immediate: true }
)
const requiredAuthContext = useRouteMeta('authContext')
const { areSpacesLoading } = useSpacesLoading({ store })
const isLoading = computed(() => {
if (unref(requiredAuthContext) === 'anonymous') {
return false
}
return unref(areSpacesLoading)
})
return {
...useSpacesLoading({ store }),
isLoading,
activeApp: useActiveApp(),
isUserContext: useUserContext({ store })
}
Expand Down

0 comments on commit b27bc11

Please sign in to comment.