Skip to content

Commit

Permalink
ディープリンクバグ修正
Browse files Browse the repository at this point in the history
  • Loading branch information
TinyKitten committed Oct 20, 2024
1 parent 3c73e61 commit 800a6e1
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 800a6e1

Please sign in to comment.