Skip to content

Commit

Permalink
Merge pull request #3786 from TrainLCD/release/canary
Browse files Browse the repository at this point in the history
Release/canary
  • Loading branch information
TinyKitten authored Oct 10, 2024
2 parents 79b4f49 + 6a46937 commit 7442d38
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 18 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 80000460
versionCode 80000470
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 = 80000461
versionCode = 80000471
versionName = "8.0.0"
}
create("prod") {
Expand Down
4 changes: 2 additions & 2 deletions src/components/RouteList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const RouteList = ({
loading,
}: {
routes: Route[]
onSelect: (item: Route) => void
onSelect: (item: Route | undefined) => void
loading: boolean
}) => {
const [trainTypeInfoModalVisible, setTrainTypeInfoModalVisible] =
Expand Down Expand Up @@ -174,7 +174,7 @@ export const RouteList = ({
disabled={loading}
stations={selectedRoute?.stops ?? []}
onClose={() => setTrainTypeInfoModalVisible(false)}
onConfirmed={() => selectedRoute && onSelect(selectedRoute)}
onConfirmed={() => onSelect(selectedRoute)}
/>
</>
)
Expand Down
2 changes: 1 addition & 1 deletion src/components/RouteListModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type Props = {
isTrainTypesLoading: boolean
error: ConnectError | null
onClose: () => void
onSelect: (route: Route) => void
onSelect: (route: Route | undefined) => void
}

const styles = StyleSheet.create({
Expand Down
6 changes: 3 additions & 3 deletions src/components/TrainTypeInfoModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type Props = {
disabled?: boolean
error: ConnectError | null
onClose: () => void
onConfirmed: (trainType: TrainType) => void
onConfirmed: (trainType: TrainType | undefined) => void
}

const styles = StyleSheet.create({
Expand Down Expand Up @@ -223,8 +223,8 @@ export const TrainTypeInfoModal: React.FC<Props> = ({
<View style={styles.buttons}>
<Button
color={isLEDTheme ? undefined : '#008ffe'}
onPress={() => trainType && onConfirmed(trainType)}
disabled={loading || !trainType || disabled}
onPress={() => onConfirmed(trainType ?? undefined)}
disabled={loading || disabled}
>
{translate('submit')}
</Button>
Expand Down
14 changes: 4 additions & 10 deletions src/screens/RouteSearchScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,9 @@ const RouteSearchScreen = () => {
selectedLine: stationFromSearch.line ?? null,
}))
setSelectedStation(stationFromSearch)

if (stationFromSearch.hasTrainTypes) {
setIsRouteListModalVisible(true)
return
}

navigation.navigate('SelectBound')
setIsRouteListModalVisible(true)
},
[navigation, setLineState]
[setLineState]
)

const onKeyPress = useCallback(
Expand All @@ -174,8 +168,8 @@ const RouteSearchScreen = () => {
)

const handleSelect = useCallback(
async (route: Route) => {
const trainType = route.stops.find(
async (route: Route | undefined) => {
const trainType = route?.stops.find(
(s) => s.groupId === currentStation?.groupId
)?.trainType

Expand Down

0 comments on commit 7442d38

Please sign in to comment.