From 6b266ff12898ac2adcc1a60f0d206093abe9e746 Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Mon, 15 Dec 2025 12:19:33 +0000 Subject: [PATCH] refactor: migrate dashboard page from useUser to currentUserAtom --- surfsense_web/app/dashboard/page.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/surfsense_web/app/dashboard/page.tsx b/surfsense_web/app/dashboard/page.tsx index b1525a9db..d3d88a47a 100644 --- a/surfsense_web/app/dashboard/page.tsx +++ b/surfsense_web/app/dashboard/page.tsx @@ -35,10 +35,10 @@ import { } from "@/components/ui/card"; import { Spotlight } from "@/components/ui/spotlight"; import { Tilt } from "@/components/ui/tilt"; -import { useUser } from "@/hooks"; import { searchSpacesAtom } from "@/atoms/search-spaces/search-space-query.atoms"; import { deleteSearchSpaceMutationAtom } from "@/atoms/search-spaces/search-space-mutation.atoms"; import { authenticatedFetch } from "@/lib/auth-utils"; +import { currentUserAtom } from "@/atoms/user/user-query.atoms"; /** * Formats a date string into a readable format @@ -159,8 +159,7 @@ const DashboardPage = () => { const { data: searchSpaces = [], isLoading: loading, error, refetch: refreshSearchSpaces } = useAtomValue(searchSpacesAtom); const { mutateAsync: deleteSearchSpace } = useAtomValue(deleteSearchSpaceMutationAtom); - // Fetch user details - const { user, loading: isLoadingUser, error: userError } = useUser(); + const { data: user, isPending: isLoadingUser, error: userError } = useAtomValue(currentUserAtom); // Create user object for UserDropdown const customUser = {