Skip to content

Commit f6898d1

Browse files
committed
지하철 상세경로 데이터 정제 변수 수정
1 parent 85dcfd0 commit f6898d1

File tree

1 file changed

+4
-3
lines changed
  • src/screens/searchPathResultDetailScreen

1 file changed

+4
-3
lines changed

src/screens/searchPathResultDetailScreen/index.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ import { useMemo, useState } from 'react';
33
import { FlatList, View } from 'react-native';
44

55
import { FontText, IconButton } from '@/global/ui';
6-
import { useRootNavigation } from '@/navigation/RootNavigation';
76
import { useRoute } from '@react-navigation/native';
87
import NewRouteSaveModal from './components/NewRouteSaveModal';
98
import SearchPathDetailItem from './components/SearchPathDetailItem';
109
import { useDeleteSavedSubwayRoute } from '@/global/apis/hook';
1110
import { Path, SubPath } from '@/global/apis/entity';
11+
import { useHomeNavigation } from '@/navigation/HomeNavigation';
1212

1313
const SearchPathResultDetailScreen = () => {
1414
const route = useRoute();
15-
const navigation = useRootNavigation();
15+
const navigation = useHomeNavigation();
1616

1717
const { deleteMutate } = useDeleteSavedSubwayRoute({
1818
onSuccess: () => {
@@ -24,7 +24,8 @@ const SearchPathResultDetailScreen = () => {
2424
const [isSaveRouteModalOpen, setIsSaveRouteModalOpen] = useState<boolean>(false);
2525

2626
const freshSubPathData: SubPath[] = useMemo(() => {
27-
const { subPaths } = route.params as Path;
27+
const { state } = route.params as { state: Path };
28+
const subPaths = state.subPaths;
2829
if (!subPaths) return [];
2930
return Object.values(subPaths).filter((item) => !!item.lanes.length && !!item.stations.length);
3031
}, [route]);

0 commit comments

Comments
 (0)