瀏覽代碼

♻️ refactor(auth): update useQuery loading state naming

- replace isLoading with isFetching to align with React Query v4+ API conventions
- maintain same loading state functionality while using correct query status property
yourname 4 月之前
父節點
當前提交
ac7b50c01f
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/client/home/hooks/AuthProvider.tsx

+ 1 - 1
src/client/home/hooks/AuthProvider.tsx

@@ -49,7 +49,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children
   };
 
   // 使用useQuery检查登录状态
-  const { isLoading } = useQuery({
+  const { isFetching: isLoading } = useQuery({
     queryKey: ['auth', 'status', token],
     queryFn: async () => {
       if (!token) {