From 4c3563a6a011a39519b8693d1a85a60641c95059 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 20 Mar 2025 08:43:07 -0400 Subject: [PATCH 1/3] fix(UserSettings): Don't pass recent trip modes (use mode selector modes) --- lib/components/form/user-settings.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/components/form/user-settings.js b/lib/components/form/user-settings.js index 699ba6de3..1995374cb 100644 --- a/lib/components/form/user-settings.js +++ b/lib/components/form/user-settings.js @@ -337,7 +337,9 @@ const TripRequest = ({ // In previous versions of this code, tripRequest.id was passed to setQueryParam, // however that causes an extra entry to be added to the recent searches on click, // in addition to the entry added when clicking the "Plan" (magnifying glass) button. - setQueryParam(query) + // Also, pass query params without the modes, otherwise the selecton from the mode selector will not apply. + const { modes, ...queryWithoutModes } = query + setQueryParam(queryWithoutModes) if (query.modeButtons) { setUrlSearch({ modeButtons: query.modeButtons }) } From ca798f37dd0188943fe09f1469580e42a845500d Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 20 Mar 2025 10:23:24 -0400 Subject: [PATCH 2/3] fix(UserSettings): Display search time instead of 'Now' after clicking recent search --- lib/components/form/user-settings.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/components/form/user-settings.js b/lib/components/form/user-settings.js index 1995374cb..9cfa4667b 100644 --- a/lib/components/form/user-settings.js +++ b/lib/components/form/user-settings.js @@ -337,8 +337,12 @@ const TripRequest = ({ // In previous versions of this code, tripRequest.id was passed to setQueryParam, // however that causes an extra entry to be added to the recent searches on click, // in addition to the entry added when clicking the "Plan" (magnifying glass) button. - // Also, pass query params without the modes, otherwise the selecton from the mode selector will not apply. + // Also, pass query params without the mode, otherwise the selection from the mode selector will not apply. const { modes, ...queryWithoutModes } = query + // If depart/arrive is 'NOW', change that to 'DEPART' so that the correct time is shown in the date button. + if (queryWithoutModes.departArrive === 'NOW') { + queryWithoutModes.departArrive = 'DEPART' + } setQueryParam(queryWithoutModes) if (query.modeButtons) { setUrlSearch({ modeButtons: query.modeButtons }) From 826d86038e63b080195310a726b15028a6365c6d Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 3 Apr 2025 10:12:28 -0400 Subject: [PATCH 3/3] fix(UserSettings): Preserve date/time selector after selecting recent search. --- lib/components/form/user-settings.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/components/form/user-settings.js b/lib/components/form/user-settings.js index 9cfa4667b..e72c770ac 100644 --- a/lib/components/form/user-settings.js +++ b/lib/components/form/user-settings.js @@ -337,12 +337,10 @@ const TripRequest = ({ // In previous versions of this code, tripRequest.id was passed to setQueryParam, // however that causes an extra entry to be added to the recent searches on click, // in addition to the entry added when clicking the "Plan" (magnifying glass) button. - // Also, pass query params without the mode, otherwise the selection from the mode selector will not apply. - const { modes, ...queryWithoutModes } = query - // If depart/arrive is 'NOW', change that to 'DEPART' so that the correct time is shown in the date button. - if (queryWithoutModes.departArrive === 'NOW') { - queryWithoutModes.departArrive = 'DEPART' - } + + // Also, exclude the mode and date/time setting of the the selected search + // to not overwrite settings the user was using prior to this action. + const { date, departArrive, modes, time, ...queryWithoutModes } = query setQueryParam(queryWithoutModes) if (query.modeButtons) { setUrlSearch({ modeButtons: query.modeButtons })