diff --git a/src/components/common/LogPage/index.tsx b/src/components/common/LogPage/index.tsx index c61d683a..d9b44cb7 100644 --- a/src/components/common/LogPage/index.tsx +++ b/src/components/common/LogPage/index.tsx @@ -7,13 +7,14 @@ import { useUser } from 'utils/hooks/state/useUser'; const userUniqueIdGenerator = (userInfo: UserResponse | null | undefined) => { if (userInfo?.anonymous_nickname) { - localStorage.setItem('uuid', userInfo.anonymous_nickname); - return userInfo.anonymous_nickname; + const modifiedAnonymous = userInfo.anonymous_nickname.replace(/^익명_/, 'anonymous_'); + localStorage.setItem('uuid', modifiedAnonymous); + return modifiedAnonymous; } let uuid = localStorage.getItem('uuid'); - if (!uuid || uuid.includes('익명')) { + if (!uuid || uuid.startsWith('anonymous_')) { uuid = uuidv4(); localStorage.setItem('uuid', uuid); }