This commit is contained in:
2026-07-01 22:29:18 +03:30
parent 4fa2c0d57d
commit ce8029919c
14 changed files with 229 additions and 157 deletions
+1 -10
View File
@@ -2,7 +2,6 @@ import { computed, watch } from 'vue'
import router from '@/router'
import { authenticateWithFingerprint, getToken, isIphone, removeToken } from '@/utils'
import { useUserStore } from '@/store/userStore'
import { useWalletStore } from '@/store/walletStore'
import type { NavigationGuardNext, RouteLocationNormalized } from 'vue-router'
import { useAuthStore } from '@/store/useAuthStore'
import {
@@ -16,7 +15,6 @@ import {
export function setupRouterGuards() {
const userStore = useUserStore()
const walletStore = useWalletStore()
const authStore = useAuthStore()
const isApple: boolean = isIphone()
@@ -29,16 +27,9 @@ export function setupRouterGuards() {
return
}
const tasks: Promise<unknown>[] = [
walletStore.getLimitedPrice(),
walletStore.getLimitedBuyGold(),
]
if (!userStore.userInfo) {
tasks.push(userStore.getMyInfo())
await userStore.getMyInfo()
}
await Promise.all(tasks)
}
function goToLogin(to: RouteLocationNormalized, next: NavigationGuardNext) {