fix(shop): use backend shop in navigation
This commit is contained in:
@@ -15,12 +15,12 @@ import {
|
||||
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from "@/components/ui/sheet"
|
||||
import { getCurrentUserForLogin, logout as logoutRequest, switchCurrentRole } from "@/lib/api"
|
||||
import { toApiError } from "@/lib/errors"
|
||||
import { useMyShop } from "@/lib/hooks/use-my-shop"
|
||||
import { notifyInfo } from "@/lib/toast"
|
||||
import type { UserRole } from "@/lib/types"
|
||||
import { cn } from "@/lib/utils"
|
||||
import { useAuthStore } from "@/store/auth"
|
||||
import { useNotificationStore } from "@/store/notifications"
|
||||
import { useShopStore } from "@/store/shops"
|
||||
import {
|
||||
Bell,
|
||||
Gamepad2,
|
||||
@@ -57,10 +57,8 @@ export function Header() {
|
||||
logout: clearAuth,
|
||||
user,
|
||||
} = useAuthStore()
|
||||
const ownerShop = useShopStore((state) =>
|
||||
user ? state.shops.find((shop) => shop.owner.id === user.id) : undefined,
|
||||
)
|
||||
const canOpenDashboard = currentRole === "player" || currentRole === "owner"
|
||||
const { shop: ownerShop } = useMyShop(isAuthenticated && currentRole === "owner")
|
||||
|
||||
const navLinks =
|
||||
currentRole === "consumer"
|
||||
|
||||
Reference in New Issue
Block a user