File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1
1
import debounce from 'lodash.debounce'
2
2
import qs from 'qs'
3
+ import moment from 'moment'
3
4
import { createAction } from 'redux-actions'
4
5
5
6
import { routingQuery } from './api'
@@ -85,8 +86,13 @@ let lastDebouncePlanTimeMs
85
86
86
87
export function formChanged ( ) {
87
88
return function ( dispatch , getState ) {
88
- dispatch ( changingForm ( ) )
89
89
const otpState = getState ( ) . otp
90
+ // If departArrive is set to 'NOW', update the query time to current
91
+ if ( otpState . currentQuery && otpState . currentQuery . departArrive === 'NOW' ) {
92
+ dispatch ( settingQueryParam ( { time : moment ( ) . format ( 'HH:mm' ) } ) )
93
+ }
94
+
95
+ dispatch ( changingForm ( ) )
90
96
const { autoPlan, debouncePlanTimeMs} = otpState . config
91
97
// check if a trip plan should be made
92
98
if ( autoPlan && queryIsValid ( otpState ) ) {
You can’t perform that action at this time.
0 commit comments