Skip to content

Commit

Permalink
Fix initial auth/me call, skip query until token is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
dauglyon committed Oct 21, 2024
1 parent e0cf6a3 commit 1fd8824
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/features/auth/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
export const useAuthMe = () => {
const dispatch = useAppDispatch();
const token = useAppSelector(authToken) || '';
const authAPIQuery = getMe.useQuery({ token });
const authAPIQuery = getMe.useQuery({ token }, { skip: !token });
useEffect(() => {
if (authAPIQuery && authAPIQuery.isSuccess && authAPIQuery.data) {
const data = authAPIQuery.data;
Expand Down

0 comments on commit 1fd8824

Please sign in to comment.