Avoid loading user info twice to show profile.
This commit is contained in:
parent
ba5f2d8bd9
commit
74ba443d3d
@ -86,15 +86,7 @@ import { registerCredential } from '@/utils/passkey'
|
|||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
const updateInterval = ref(null)
|
const updateInterval = ref(null)
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(() => {
|
||||||
try {
|
|
||||||
await authStore.loadUserInfo()
|
|
||||||
} catch (error) {
|
|
||||||
authStore.showMessage(`Failed to load user info: ${error.message}`, 'error')
|
|
||||||
authStore.currentView = 'login'
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
updateInterval.value = setInterval(() => {
|
updateInterval.value = setInterval(() => {
|
||||||
// Trigger Vue reactivity to update formatDate fields
|
// Trigger Vue reactivity to update formatDate fields
|
||||||
authStore.currentUser = { ...authStore.currentUser }
|
authStore.currentUser = { ...authStore.currentUser }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user