From 971f217dc52d48a5a8f91582f254a25e600f5199 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 12 Nov 2024 02:46:06 +0000 Subject: [PATCH 1/2] Create draft PR for #946 From dfc7c7a088016db03458aacda5f5f0da3982a9c7 Mon Sep 17 00:00:00 2001 From: Jeongwoo Park Date: Tue, 12 Nov 2024 11:53:24 +0900 Subject: [PATCH 2/2] =?UTF-8?q?refactor:=20gcTime=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?=EB=B0=8F=20clear=EB=A1=9C=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/ErrorPage/index.tsx | 3 +++ frontend/src/router/AppRouter.tsx | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/ErrorPage/index.tsx b/frontend/src/pages/ErrorPage/index.tsx index 499d2459c..db0e9f0c5 100644 --- a/frontend/src/pages/ErrorPage/index.tsx +++ b/frontend/src/pages/ErrorPage/index.tsx @@ -1,3 +1,4 @@ +import { useQueryClient } from '@tanstack/react-query'; import ApiError from '@api/ApiError'; import Button from '@components/_common/atoms/Button'; import { ButtonColor } from '@components/_common/atoms/Button/style'; @@ -106,6 +107,7 @@ export default function ErrorPage() { const error = useRouteError(); const navigate = useNavigate(); const { clearClubId } = useClubId(); + const queryClient = useQueryClient(); let status; @@ -114,6 +116,7 @@ export default function ErrorPage() { } else if (error instanceof ApiError) { status = error.statusCode; if (status === 401) { + queryClient.clear(); clearClubId(); } } diff --git a/frontend/src/router/AppRouter.tsx b/frontend/src/router/AppRouter.tsx index 257964cad..d68dcbecd 100644 --- a/frontend/src/router/AppRouter.tsx +++ b/frontend/src/router/AppRouter.tsx @@ -80,7 +80,6 @@ export default function AppRouter() { queries: { throwOnError: true, retry: 0, - gcTime: 0, }, mutations: { onError: (error) => {