diff --git a/client/src/layouts/RootLayout.tsx b/client/src/layouts/RootLayout.tsx index 9cb65489..cc184b5a 100644 --- a/client/src/layouts/RootLayout.tsx +++ b/client/src/layouts/RootLayout.tsx @@ -1,9 +1,17 @@ +import { useEffect } from 'react'; import { Outlet } from 'react-router-dom'; import helpIcon from '@/assets/help-icon.svg'; import BackgroundMusicButton from '@/components/bgm-button/BackgroundMusicButton'; import { Button } from '@/components/ui/Button'; +import { playerIdStorageUtils } from '@/utils/playerIdStorage'; const RootLayout = () => { + // 레이아웃 마운트 시 localStorage 초기화 + useEffect(() => { + playerIdStorageUtils.removeAllPlayerIds(); + localStorage.removeItem('shouldRedirect'); + }, []); + return (