@@ -3,16 +3,16 @@ import { useMemo, useState } from 'react';
3
3
import { FlatList , View } from 'react-native' ;
4
4
5
5
import { FontText , IconButton } from '@/global/ui' ;
6
- import { useRootNavigation } from '@/navigation/RootNavigation' ;
7
6
import { useRoute } from '@react-navigation/native' ;
8
7
import NewRouteSaveModal from './components/NewRouteSaveModal' ;
9
8
import SearchPathDetailItem from './components/SearchPathDetailItem' ;
10
9
import { useDeleteSavedSubwayRoute } from '@/global/apis/hook' ;
11
10
import { Path , SubPath } from '@/global/apis/entity' ;
11
+ import { useHomeNavigation } from '@/navigation/HomeNavigation' ;
12
12
13
13
const SearchPathResultDetailScreen = ( ) => {
14
14
const route = useRoute ( ) ;
15
- const navigation = useRootNavigation ( ) ;
15
+ const navigation = useHomeNavigation ( ) ;
16
16
17
17
const { deleteMutate } = useDeleteSavedSubwayRoute ( {
18
18
onSuccess : ( ) => {
@@ -24,7 +24,8 @@ const SearchPathResultDetailScreen = () => {
24
24
const [ isSaveRouteModalOpen , setIsSaveRouteModalOpen ] = useState < boolean > ( false ) ;
25
25
26
26
const freshSubPathData : SubPath [ ] = useMemo ( ( ) => {
27
- const { subPaths } = route . params as Path ;
27
+ const { state } = route . params as { state : Path } ;
28
+ const subPaths = state . subPaths ;
28
29
if ( ! subPaths ) return [ ] ;
29
30
return Object . values ( subPaths ) . filter ( ( item ) => ! ! item . lanes . length && ! ! item . stations . length ) ;
30
31
} , [ route ] ) ;
0 commit comments