Skip to content

Commit

Permalink
hotfix: 유저 닉네임 저장 방식 에러 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
AAminha committed May 22, 2024
1 parent 3f3a503 commit 10df020
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/OnboardingPage/SetupBranding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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('/');
})
Expand Down
8 changes: 8 additions & 0 deletions src/services/UserService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 10df020

Please sign in to comment.