From 7a89c9d75b8ee8cd1a0c0e61ac95a7e36f5ef511 Mon Sep 17 00:00:00 2001 From: kibin Date: Wed, 1 Apr 2026 09:18:33 +0000 Subject: [PATCH 1/2] fix: use useAuthStore instead of useAuth in tickets page --- app/(app)/tickets/page.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/(app)/tickets/page.tsx b/app/(app)/tickets/page.tsx index 7b4f25f..3a0234d 100644 --- a/app/(app)/tickets/page.tsx +++ b/app/(app)/tickets/page.tsx @@ -3,7 +3,7 @@ import { useState } from "react"; import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query"; import { RefreshCw, Ticket, Plus, Send, RotateCcw, User, MapPin, Zap } from "lucide-react"; -import { useAuth } from "@/contexts/AuthContext"; +import { useAuthStore } from "@/lib/auth-store"; import { Card, CardContent, CardHeader } from "@/components/ui/Card"; import { Table, TableHead, TableBody, TableRow, Th, Td, EmptyState } from "@/components/ui/Table"; import { Badge } from "@/components/ui/Badge"; @@ -44,7 +44,7 @@ const prevStatus: Record = { export default function TicketsPage() { const qc = useQueryClient(); - const { user } = useAuth(); + const user = useAuthStore((s) => s.user); const [search, setSearch] = useState(""); const [statusFilter, setStatusFilter] = useState(""); const [typeFilter, setTypeFilter] = useState(""); -- 2.43.0 From 35018e4b883076867f46136b4209abd2a85f0a6d Mon Sep 17 00:00:00 2001 From: kibin Date: Wed, 1 Apr 2026 09:18:35 +0000 Subject: [PATCH 2/2] fix: use useAuthStore instead of useAuth in profile page --- app/(app)/profile/page.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/(app)/profile/page.tsx b/app/(app)/profile/page.tsx index 9e3942f..0ae4bab 100644 --- a/app/(app)/profile/page.tsx +++ b/app/(app)/profile/page.tsx @@ -2,7 +2,7 @@ import { useState } from "react"; import { useMutation } from "@tanstack/react-query"; -import { useAuth } from "@/contexts/AuthContext"; +import { useAuthStore } from "@/lib/auth-store"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/Card"; import { Button } from "@/components/ui/Button"; import { Input } from "@/components/ui/Input"; @@ -11,7 +11,7 @@ import api from "@/lib/api"; import { toast } from "sonner"; export default function ProfilePage() { - const { user } = useAuth(); + const user = useAuthStore((s) => s.user); const [infoForm, setInfoForm] = useState({ firstName: (user as any)?.firstName ?? user?.name?.split(" ")[0] ?? "", -- 2.43.0