Skip to content

Commit 5de94a7

Browse files
Merge branch 'update-core-utils-and-trip-form' of https://github.com/opentripplanner/otp-react-redux into update-core-utils-and-trip-form
2 parents e8b192f + 6771b27 commit 5de94a7

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

lib/actions/ui.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,16 @@ export function setViewedRoute(payload) {
9595

9696
dispatch(viewRoute(payload))
9797

98-
const path = getPathFromParts(
99-
'route',
100-
payload?.routeId,
101-
// If a pattern is supplied, include pattern in path
102-
payload?.patternId && 'pattern',
103-
payload?.patternId
104-
)
105-
dispatch(routeTo(path))
98+
if (payload?.routeId) {
99+
const path = getPathFromParts(
100+
'route',
101+
payload?.routeId,
102+
// If a pattern is supplied, include pattern in path
103+
payload?.patternId && 'pattern',
104+
payload?.patternId
105+
)
106+
dispatch(routeTo(path))
107+
}
106108
}
107109
}
108110

@@ -289,6 +291,7 @@ export function matchContentToUrl(map, location) {
289291

290292
dispatch(setMainPanelContent(MainPanelContent.NEARBY_VIEW))
291293
}
294+
dispatch(setViewedRoute(null))
292295
break
293296
case 'trip':
294297
dispatch(setViewedStop(null))

0 commit comments

Comments
 (0)