Skip to content

Commit

Permalink
feat: 이미 로그인한 사용자는 스플래시뷰로 넘어가지 않게 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Arooming committed Jan 19, 2024
1 parent 2f10e5b commit 41334b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/SelectView/SelectView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import SplashPage from '../Splash/page/SplashPage';
function SelectView() {
const { state } = useLocation();
const [step, setStep] = useState(state?.step ? state.step : 0);
const token = localStorage.getItem('token');

const handleStep = (step: number) => {
setStep(step);
};

return step === 0 ? (
return !token && step === 0 ? (
<SplashPage handleStep={handleStep} />
) : (
<Home handleStep={handleStep} />
Expand Down
6 changes: 1 addition & 5 deletions src/Splash/page/SplashPage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect } from 'react';
// import { useEffect } from 'react';

import LoadingPage from '../../../components/common/LoadingPage';
import Body from '../../component/Body';
Expand All @@ -14,10 +14,6 @@ export interface StepProps {
function SplashPage({ handleStep }: StepProps) {
const { isLoading } = useGetNoteNum();

useEffect(() => {
handleStep(0);
}, []);

return (
<S.Wrapper>
{isLoading && <LoadingPage />}
Expand Down

0 comments on commit 41334b1

Please sign in to comment.