Skip to content

Commit

Permalink
fix: window reload
Browse files Browse the repository at this point in the history
  • Loading branch information
Low-ProFiles committed Aug 23, 2024
1 parent ede2f6d commit b981bfd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/pages/team/team.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import CreateTeam from '@assets/team/create-team.svg';
import { useNavigate } from 'react-router-dom';
import SearchTeamSection from '@components/team/SelectTeamSection';
import { getTeamById } from '@apis/team/getTeamById';
import { useQuery, useQueryClient } from '@tanstack/react-query';
import { useQuery } from '@tanstack/react-query';
import { useEffect } from 'react';

export const TeamPage = () => {
const navigate = useNavigate();
const queryClient = useQueryClient();
const { data: team, isLoading } = useQuery({
queryKey: ['team'],
queryFn: getTeamById
Expand All @@ -25,9 +24,9 @@ export const TeamPage = () => {

useEffect(() => {
if (!isLoading && !team) {
queryClient.refetchQueries({ queryKey: ['team'] });
window.location.reload();
}
}, [isLoading, team, queryClient]);
}, [isLoading, team]);

return (
<TeamContainer>
Expand Down

0 comments on commit b981bfd

Please sign in to comment.