Fixed Loading Error at Login/Tenant Switch
This commit is contained in:
@@ -15,7 +15,7 @@ const selectedTenant = ref(auth.user.tenant_id)
|
||||
v-model="selectedTenant"
|
||||
>
|
||||
<UButton color="gray" variant="ghost" :class="[open && 'bg-gray-50 dark:bg-gray-800']" class="w-full">
|
||||
<UAvatar :alt="auth.tenants.find(i => auth.activeTenant === i.id).name" size="md" />
|
||||
<UAvatar :alt="auth.activeTenantData?.name" size="md" />
|
||||
|
||||
<span class="truncate text-gray-900 dark:text-white font-semibold">{{auth.tenants.find(i => auth.activeTenant === i.id).name}}</span>
|
||||
</UButton>
|
||||
|
||||
@@ -114,7 +114,7 @@ const footerLinks = [
|
||||
|
||||
<template>
|
||||
<div v-if="!auth.loading">
|
||||
<div v-if="auth.tenants.find(t => t.id === auth.activeTenant).locked === 'maintenance_tenant'">
|
||||
<div v-if="auth.activeTenantData?.locked === 'maintenance_tenant'">
|
||||
<UContainer class="min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900">
|
||||
<UCard class="max-w-lg text-center p-10">
|
||||
<UColorModeImage
|
||||
@@ -151,7 +151,7 @@ const footerLinks = [
|
||||
</UCard>
|
||||
</UContainer>
|
||||
</div>
|
||||
<div v-else-if="auth.tenants.find(t => t.id === auth.activeTenant).locked === 'maintenance'">
|
||||
<div v-else-if="auth.activeTenantData?.locked === 'maintenance'">
|
||||
<UContainer class="min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900">
|
||||
<UCard class="max-w-lg text-center p-10">
|
||||
<UColorModeImage
|
||||
@@ -181,7 +181,7 @@ const footerLinks = [
|
||||
</UCard>
|
||||
</UContainer>
|
||||
</div>
|
||||
<div v-else-if="auth.tenants.find(t => t.id === auth.activeTenant).locked === 'no_subscription'">
|
||||
<div v-else-if="auth.activeTenantData?.locked === 'no_subscription'">
|
||||
<UContainer class="min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900">
|
||||
<UCard class="max-w-lg text-center p-10">
|
||||
<UColorModeImage
|
||||
|
||||
@@ -15,6 +15,7 @@ export const useAuthStore = defineStore("auth", {
|
||||
actions: {
|
||||
async init(token) {
|
||||
await this.fetchMe(token)
|
||||
navigateTo("/")
|
||||
},
|
||||
|
||||
async login(email: string, password: string) {
|
||||
|
||||
Reference in New Issue
Block a user