Skip to content

Commit

Permalink
🐛 잘못 설정된 주석 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
anttiey committed Oct 24, 2024
1 parent d38a8f4 commit 662a2c5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions frontend/src/pages/PrivateRoutes.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useState } from 'react';
import { Navigate, Outlet, useParams } from 'react-router-dom';
import { Navigate, Outlet, useLocation, useParams } from 'react-router-dom';

import Loading from '@/pages/Loading/Loading';

Expand All @@ -8,19 +8,19 @@ import useToastStore from '@/stores/toastStore';
import { getPairRoomExists } from '@/apis/pairRoom';

const PrivateRoutes = () => {
// const location = useLocation();
const location = useLocation();
const { accessCode } = useParams();

const [isValid, setIsValid] = useState<boolean | null>(null);

const { addToast } = useToastStore();

const validateAccess = async () => {
// if (!accessCode || !location.state?.valid) {
// setIsValid(false);
// addToast({ status: 'ERROR', message: '유효하지 않은 접근입니다. 올바른 경로로 접근해 주세요.' });
// return;
// }
if (!accessCode || !location.state?.valid) {
setIsValid(false);
addToast({ status: 'ERROR', message: '유효하지 않은 접근입니다. 올바른 경로로 접근해 주세요.' });
return;
}

const { exists } = await getPairRoomExists(accessCode || '');

Expand Down

0 comments on commit 662a2c5

Please sign in to comment.