diff --git a/android/app/build.gradle b/android/app/build.gradle index 538e161e1..6e76ba3a8 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -121,7 +121,7 @@ android { applicationIdSuffix ".dev" versionNameSuffix "-dev" // 10203010 <- 10203(v1.2.3 version name)+01(build number)+0(Android app) - versionCode 80000480 + versionCode 80000490 versionName "8.0.0" } prod { diff --git a/android/wearable/build.gradle.kts b/android/wearable/build.gradle.kts index b187f4399..98c0a2da0 100644 --- a/android/wearable/build.gradle.kts +++ b/android/wearable/build.gradle.kts @@ -34,7 +34,7 @@ android { applicationIdSuffix = ".dev" versionNameSuffix = "-dev" // 10203011 <- 10203(v1.2.3 version name)+01(build number)+1(Wearable app) - versionCode = 80000481 + versionCode = 80000491 versionName = "8.0.0" } create("prod") { diff --git a/package-lock.json b/package-lock.json index e52cdb041..45d950387 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@connectrpc/connect-query": "^1.3.1", "@expo/react-native-action-sheet": "^3.8.0", - "@expo/vector-icons": "^14.0.0", + "@expo/vector-icons": "^14.0.4", "@react-native-async-storage/async-storage": "1.23.1", "@react-native-community/netinfo": "11.3.1", "@react-native-firebase/analytics": "^18.3.2", @@ -3763,9 +3763,12 @@ } }, "node_modules/@expo/vector-icons": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/@expo/vector-icons/-/vector-icons-14.0.0.tgz", - "integrity": "sha512-5orm59pdnBQlovhU9k4DbjMUZBHNlku7IRgFY56f7pcaaCnXq9yaLJoOQl9sMwNdFzf4gnkTyHmR5uN10mI9rA==" + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@expo/vector-icons/-/vector-icons-14.0.4.tgz", + "integrity": "sha512-+yKshcbpDfbV4zoXOgHxCwh7lkE9VVTT5T03OUlBsqfze1PLy6Hi4jp1vSb1GVbY6eskvMIivGVc9SKzIv0oEQ==", + "dependencies": { + "prop-types": "^15.8.1" + } }, "node_modules/@expo/xcpretty": { "version": "4.3.1", diff --git a/package.json b/package.json index b26130dd4..e686dafcd 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "dependencies": { "@connectrpc/connect-query": "^1.3.1", "@expo/react-native-action-sheet": "^3.8.0", - "@expo/vector-icons": "^14.0.0", + "@expo/vector-icons": "^14.0.4", "@react-native-async-storage/async-storage": "1.23.1", "@react-native-community/netinfo": "11.3.1", "@react-native-firebase/analytics": "^18.3.2", diff --git a/src/screens/RouteSearchScreen.tsx b/src/screens/RouteSearchScreen.tsx index c58a38712..a9d05cf29 100644 --- a/src/screens/RouteSearchScreen.tsx +++ b/src/screens/RouteSearchScreen.tsx @@ -30,6 +30,7 @@ import { FONTS } from '../constants' import { useCurrentStation } from '../hooks/useCurrentStation' import { useThemeStore } from '../hooks/useThemeStore' import { useTrainTypeStations } from '../hooks/useTrainTypeStations' +import { LineDirection } from '../models/Bound' import { APP_THEME } from '../models/Theme' import lineState from '../store/atoms/line' import navigationState from '../store/atoms/navigation' @@ -174,8 +175,27 @@ const RouteSearchScreen = () => { )?.trainType if (!trainType?.id) { + const direction: LineDirection = + (route?.stops ?? []).findIndex( + (s) => s.groupId === currentStation?.groupId + ) < + (route?.stops ?? []).findIndex( + (s) => selectedStation?.groupId === s.groupId + ) + ? 'INBOUND' + : 'OUTBOUND' + + setStationState((prev) => ({ + ...prev, + stations: route?.stops ?? [], + selectedDirection: direction, + selectedBound: + (direction === 'INBOUND' + ? route?.stops[0] + : route?.stops[route.stops.length - 1]) ?? null, + })) setNavigationState((prev) => ({ ...prev, trainType: null })) - navigation.navigate('SelectBound') + navigation.navigate('Main') return } @@ -187,17 +207,32 @@ const RouteSearchScreen = () => { (s) => s.groupId === currentStation?.groupId ) + const direction: LineDirection = + data.stations.findIndex((s) => s.groupId === currentStation?.groupId) < + data.stations.findIndex((s) => selectedStation?.groupId === s.groupId) + ? 'INBOUND' + : 'OUTBOUND' + setNavigationState((prev) => ({ ...prev, trainType: station?.trainType ?? null, })) - setStationState((prev) => ({ ...prev, stations: data.stations })) - navigation.navigate('SelectBound') + setStationState((prev) => ({ + ...prev, + stations: data.stations, + selectedDirection: direction, + selectedBound: + (direction === 'INBOUND' + ? route?.stops[0] + : route?.stops[route.stops.length - 1]) ?? null, + })) + navigation.navigate('Main') }, [ currentStation?.groupId, fetchTrainTypeFromTrainTypeId, navigation, + selectedStation?.groupId, setNavigationState, setStationState, ]