From 10df0207ae18d5fc7de5fbfbf3fd926f93b203df Mon Sep 17 00:00:00 2001 From: aaminha Date: Wed, 22 May 2024 21:04:19 +0900 Subject: [PATCH] =?UTF-8?q?hotfix:=20=EC=9C=A0=EC=A0=80=20=EB=8B=89?= =?UTF-8?q?=EB=84=A4=EC=9E=84=20=EC=A0=80=EC=9E=A5=20=EB=B0=A9=EC=8B=9D=20?= =?UTF-8?q?=EC=97=90=EB=9F=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/OnboardingPage/SetupBranding.tsx | 2 +- src/services/UserService.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/OnboardingPage/SetupBranding.tsx b/src/components/OnboardingPage/SetupBranding.tsx index d44d59c..80423b6 100644 --- a/src/components/OnboardingPage/SetupBranding.tsx +++ b/src/components/OnboardingPage/SetupBranding.tsx @@ -25,7 +25,7 @@ export const SetupBranding = () => { .register(onboarding) .then((res) => { authService.setAuthToken(res.payload.access_token); - userService.setUser({ nickname: res.payload.nickname }); + userService.updateUserNickname(res.payload.nickname); authService.deleteRegisterToken(); navigate('/'); }) diff --git a/src/services/UserService.ts b/src/services/UserService.ts index 7a60881..a022610 100644 --- a/src/services/UserService.ts +++ b/src/services/UserService.ts @@ -36,6 +36,14 @@ class UserService { } } + updateUserNickname(nickname: string) { + const user = this.getUser(); + if (!user) { + return; + } + this.setUser({ ...user, nickname }); + } + getTestState() { const user = this.getUser(); if (!user) {