Skip to content

Commit

Permalink
Merge pull request #3581 from TrainLCD/revert-3578-fix/type-change
Browse files Browse the repository at this point in the history
Revert "小田急対応時のデグレ修正"
  • Loading branch information
TinyKitten authored Jul 18, 2024
2 parents d452ebf + 18af349 commit f119349
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
7 changes: 0 additions & 7 deletions src/components/TypeChangeNotify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -910,13 +910,6 @@ const TypeChangeNotify: React.FC = () => {
}
}, [theme])

if (
!selectedBound ||
currentTypeLastStation.groupId === selectedBound.groupId
) {
return null
}

return (
<SafeAreaView style={styles.container}>
<View style={styles.top}>
Expand Down
12 changes: 4 additions & 8 deletions src/hooks/useTypeWillChange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,16 @@ export const useTypeWillChange = (): boolean => {
const nextTrainType = useNextTrainType()

const nextTrainTypeIsDifferent = useMemo(() => {
if (!trainType || !nextTrainType) {
if (!trainType) {
return false
}

if (getIsLocal(trainType) && getIsLocal(nextTrainType)) {
if (!nextTrainType) {
return false
}

// 小田急の路線同一で途中種別が変わる対応
if (
trainType.line?.id === nextTrainType.line?.id &&
trainType.line?.company?.id === nextTrainType.line?.company?.id
) {
return true
if (getIsLocal(trainType) && getIsLocal(nextTrainType)) {
return false
}

return trainType?.typeId !== nextTrainType?.typeId
Expand Down

0 comments on commit f119349

Please sign in to comment.