fix
This commit is contained in:
@@ -4,6 +4,7 @@ import { zodResolver } from '@hookform/resolvers/zod'
|
||||
import { z } from 'zod'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { useAuthStore } from '@/store/auth'
|
||||
import { useShopStore } from '@/store/shop'
|
||||
import { usersApi, telegramApi, authApi, promoApi } from '@/api'
|
||||
import type { UserStats, ShopItemPublic } from '@/types'
|
||||
import { useToast } from '@/store/toast'
|
||||
@@ -541,7 +542,7 @@ export function ProfilePage() {
|
||||
toast.success(response.data.message)
|
||||
setPromoCode('')
|
||||
// Update coin balance in store
|
||||
updateUser({ coins_balance: response.data.new_balance })
|
||||
useShopStore.getState().updateBalance(response.data.new_balance)
|
||||
} catch (error: unknown) {
|
||||
const err = error as { response?: { data?: { detail?: string } } }
|
||||
const message = err.response?.data?.detail || 'Не удалось активировать промокод'
|
||||
|
||||
Reference in New Issue
Block a user