Skip to content

Commit

Permalink
Merge pull request #3835 from TrainLCD/fix/univ-link
Browse files Browse the repository at this point in the history
ディープリンクバグ修正
  • Loading branch information
TinyKitten authored Oct 20, 2024
2 parents 3c73e61 + 800a6e1 commit 9d77438
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/hooks/useOpenRouteFromLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useMutation } from '@connectrpc/connect-query'
import { useNavigation } from '@react-navigation/native'
import { findNearest } from 'geolib'
import { useCallback, useEffect } from 'react'
import { useSetRecoilState } from 'recoil'
import { useRecoilState, useSetRecoilState } from 'recoil'
import {
getStationsByLineGroupId,
getStationsByLineId,
Expand All @@ -21,7 +21,7 @@ export const useOpenRouteFromLink = () => {
const navigation = useNavigation()
const resetState = useResetMainState()

const setStationState = useSetRecoilState(stationState)
const [{ selectedBound }, setStationState] = useRecoilState(stationState)
const setNavigationState = useSetRecoilState(navigationState)
const setLineState = useSetRecoilState(lineState)

Expand Down Expand Up @@ -82,7 +82,7 @@ export const useOpenRouteFromLink = () => {

const line = nearestStation?.line

if (!line) {
if (!line || selectedBound) {
return
}

Expand Down Expand Up @@ -110,6 +110,7 @@ export const useOpenRouteFromLink = () => {
longitude,
navigation,
resetState,
selectedBound,
setLineState,
setNavigationState,
setStationState,
Expand Down

0 comments on commit 9d77438

Please sign in to comment.