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) {