Skip to content

Commit

Permalink
Merge pull request #3794 from TrainLCD/release/canary
Browse files Browse the repository at this point in the history
Release/canary
  • Loading branch information
TinyKitten authored Oct 11, 2024
2 parents 35f78eb + 8af1691 commit 493da34
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 10 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion android/wearable/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down
11 changes: 7 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
41 changes: 38 additions & 3 deletions src/screens/RouteSearchScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
}

Expand All @@ -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,
]
Expand Down

0 comments on commit 493da34

Please sign in to comment.