Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
volar committed Jun 25, 2024
1 parent cb885cc commit 4fdc1c0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/composables/system/appInitialize.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useCookies } from '@vueuse/integrations/useCookies'
import { ref } from 'vue'
import type { NavigationGuardNext, RouteLocationNormalized } from 'vue-router'
import { isDefined, isUndefined, updateDamCurrentUser, useDamConfigState } from '@anzusystems/common-admin'
import { isDefined, isUndefined, useDamConfigState } from '@anzusystems/common-admin'
import { ROUTE } from '@/router/routes'
import { checkAbility } from '@/router/checkAbility'
import { envConfig } from '@/services/EnvConfigService'
Expand All @@ -22,9 +22,11 @@ export async function createAppInitialize(
useLoginStatus(to)
const { loadDamPrvConfig, loadDamConfigExtSystem, loadDamConfigAssetCustomFormElements } =
useDamConfigState(damClient)
const { useCurrentUser } = useAuth()
const { fetchCurrentUser, currentUser } = useCurrentUser('dam')

try {
const updateCurrentUserPromise = updateDamCurrentUser(damClient)
const updateCurrentUserPromise = fetchCurrentUser(damClient)
const loadDamConfigPromise = loadDamPrvConfig()
await Promise.all([updateCurrentUserPromise, loadDamConfigPromise])
} catch (error) {
Expand All @@ -50,9 +52,6 @@ export async function createAppInitialize(
return
}

const { useCurrentUser } = useAuth()
const { currentUser } = useCurrentUser('dam')

if (
(isStatusNotDefined() || isStatusSsoCommunicationFailure() || isStatusInternalErrorFailure()) &&
isUndefined(currentUser.value)
Expand Down

0 comments on commit 4fdc1c0

Please sign in to comment.