From b4a132f6aaf9fdf8827e7ee82872e5acd1230bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=84=EC=A7=84=ED=98=B8?= Date: Sun, 10 Mar 2024 21:48:40 +0900 Subject: [PATCH] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 114ffcdd54a2d97a35a19e1dd1a7a9993366a864 Author: 전진호 Date: Sun Mar 10 21:48:01 2024 +0900 fix: refresh token empty case commit 035ca7be84cb7b2d36284fd9c02feb9699087313 Author: Jeon Jinho Date: Sun Mar 10 14:43:31 2024 +0900 알림 기능 구현 (#245) * feat: add getNotification api * feat: add useUnreadNotifications * feat: add dot to unread item * feat: add read notification commit 8fdd7118269a6ee45ad6fe0044cb23137ceb9698 Author: Jeon Jinho Date: Sun Mar 10 14:43:16 2024 +0900 feat: add topic card action sheet (#244) * feat: add topic card action sheet * feat: disable 투표 다시하기 commit c9a80ca0ea7672ea13dbf8ada88f1872dc687d2e Author: Jeon Jinho Date: Thu Mar 7 22:12:17 2024 +0900 캐시 무효화(cache busting) (#243) --- src/routes/index.tsx | 7 ++++++- src/store/auth.ts | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/routes/index.tsx b/src/routes/index.tsx index f5164e0..073ec10 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -36,7 +36,12 @@ const AuthRoute = () => { await reLogin(); setIsLoading(false); } catch (e) { - console.error(e); + if (e instanceof Error) { + if (e.message === 'REFRESH_TOKEN_EMPTY') { + setIsLoading(false); + console.error(e); + } + } } }; diff --git a/src/store/auth.ts b/src/store/auth.ts index 0748c42..2d74fab 100644 --- a/src/store/auth.ts +++ b/src/store/auth.ts @@ -31,7 +31,7 @@ export const useAuthStore = create( if (!refreshToken) { set({ isLoggedIn: false }); - throw new Error('저장되어 있는 refreshToken이 없습니다.'); + throw new Error('REFRESH_TOKEN_EMPTY'); } try {