diff --git a/src/pages/result/components/matching-agree-view.tsx b/src/pages/result/components/matching-agree-view.tsx index 952f0f73..8d0502af 100644 --- a/src/pages/result/components/matching-agree-view.tsx +++ b/src/pages/result/components/matching-agree-view.tsx @@ -2,11 +2,10 @@ import { matchQueries } from '@apis/match/match-queries'; import Button from '@components/button/button/button'; import MatchCurrentCard from '@components/card/match-current-card/match-current-card'; import { LOTTIE_PATH } from '@constants/lotties'; -import usePreventBackNavigation from '@hooks/use-prevent-back-navigation'; import { ROUTES } from '@routes/routes-config'; import { useSuspenseQuery } from '@tanstack/react-query'; import { Lottie } from '@toss/lottie'; -import { useNavigate, useSearchParams } from 'react-router-dom'; +import { useNavigate } from 'react-router-dom'; interface MatchingAgreeViewProps { matchId: string; @@ -14,11 +13,6 @@ interface MatchingAgreeViewProps { const MatchingAgreeView = ({ matchId }: MatchingAgreeViewProps) => { const navigate = useNavigate(); - const [params] = useSearchParams(); - const cardType = params.get('cardtype'); - usePreventBackNavigation( - `${ROUTES.MATCH}?tab=${cardType === 'group' ? '그룹' : '1:1'}&filter=전체`, - ); const { data: agreeData } = useSuspenseQuery(matchQueries.COUNTED_MEMBER(Number(matchId))); const matchedCount = agreeData?.count; diff --git a/src/shared/components/header/utils/get-header.tsx b/src/shared/components/header/utils/get-header.tsx index af6bb8cb..036d1df9 100644 --- a/src/shared/components/header/utils/get-header.tsx +++ b/src/shared/components/header/utils/get-header.tsx @@ -25,12 +25,10 @@ export const getHeaderContent = ( navigate(ROUTES.HOME); return; } - if (goMatchTypes.includes(type)) { navigate(ROUTES.MATCH); return; } - if (isCreate) { return null; } @@ -43,6 +41,12 @@ export const getHeaderContent = ( navigate(ROUTES.CHAT); }; + const isResult = Boolean(matchPath(`${ROUTES.RESULT()}`, pathname)); + const isGroupAgree = isResult && urlParams.get('type') === 'agree'; + if (isGroupAgree) { + return null; + } + if (pathname === ROUTES.HOME) { return (