Skip to content

Commit 5dac286

Browse files
Merge pull request #1369 from opentripplanner/fix-recent-trips-actions
Fix Recent Trips Actions
2 parents 9c4450a + b1e1a96 commit 5dac286

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/components/form/user-settings.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,11 @@ const TripRequest = ({
337337
// In previous versions of this code, tripRequest.id was passed to setQueryParam,
338338
// however that causes an extra entry to be added to the recent searches on click,
339339
// in addition to the entry added when clicking the "Plan" (magnifying glass) button.
340-
setQueryParam(query)
340+
341+
// Also, exclude the mode and date/time setting of the the selected search
342+
// to not overwrite settings the user was using prior to this action.
343+
const { date, departArrive, modes, time, ...queryWithoutModes } = query
344+
setQueryParam(queryWithoutModes)
341345
if (query.modeButtons) {
342346
setUrlSearch({ modeButtons: query.modeButtons })
343347
}

0 commit comments

Comments
 (0)