@@ -321,8 +321,8 @@ var queryToPropsHOC = function queryToPropsHOC(DecoratedComponent, config) {
321321 _this = _possibleConstructorReturn ( this , _getPrototypeOf ( queryToPropsComponent ) . call ( this , props ) ) ;
322322
323323 _defineProperty ( _assertThisInitialized ( _this ) , "__getLocationQueryObj" , function ( location ) {
324- var currLocation = location || _this . currLocation ;
325- return currLocation ? queryString . parse ( currLocation . search , {
324+ var l = location || _this . currLocation ;
325+ return l ? queryString . parse ( l . search , {
326326 arrayFormat : 'comma'
327327 } ) : { } ;
328328 } ) ;
@@ -334,10 +334,10 @@ var queryToPropsHOC = function queryToPropsHOC(DecoratedComponent, config) {
334334 } ) ;
335335
336336 _defineProperty ( _assertThisInitialized ( _this ) , "__getValidatedQueryObj" , function ( location ) {
337- var currentQueryObj = _this . __getLocationQueryObj ( location ) ;
337+ var queryObj = _this . __getLocationQueryObj ( location ) ;
338338
339339 var filterKeys = Object . keys ( queryPropsConfig ) ;
340- var filterQueryObj = filterObjWithDefaultObj ( currentQueryObj , defaultState , filterKeys ) ;
340+ var filterQueryObj = filterObjWithDefaultObj ( queryObj , defaultState , filterKeys ) ;
341341 var decodedQueryObj = decodeObj ( filterQueryObj , queryPropsConfig ) ;
342342 var validatedQueryObj = validateObject ( decodedQueryObj , defaultState , validatorMap ) ;
343343 return validatedQueryObj ;
@@ -358,10 +358,9 @@ var queryToPropsHOC = function queryToPropsHOC(DecoratedComponent, config) {
358358
359359 var validatedState = validateObject ( newState , defaultState , validatorMap ) ;
360360
361- _this . __updateUrl ( validatedState ) ; // this.currLocation has not been changed at this time
361+ _this . __updateUrl ( validatedState ) ;
362362
363-
364- var prevValidatedQueryObj = _this . __getValidatedQueryObj ( ) ;
363+ var prevValidatedQueryObj = _this . __getValidatedQueryObj ( _this . prevLocation ) ;
365364
366365 if ( ! deepEqual ( prevValidatedQueryObj , validatedState ) ) {
367366 _this . setState ( _objectSpread ( { } , validatedState ) , function ( ) {
@@ -371,6 +370,7 @@ var queryToPropsHOC = function queryToPropsHOC(DecoratedComponent, config) {
371370 } ) ;
372371
373372 _defineProperty ( _assertThisInitialized ( _this ) , "handleRouteChanged" , function ( prevLocation , currLocation ) {
373+ _this . prevLocation = prevLocation ;
374374 _this . currLocation = currLocation ;
375375
376376 var validatedQueryObj = _this . __getValidatedQueryObj ( currLocation ) ;
@@ -385,6 +385,7 @@ var queryToPropsHOC = function queryToPropsHOC(DecoratedComponent, config) {
385385 } ) ;
386386
387387 _this . __firstCallHandleRouteChanged = false ;
388+ _this . prevLocation = null ;
388389 _this . currLocation = null ;
389390
390391 var _validatedQueryObj = _this . __getValidatedQueryObj ( props . location ) ;
0 commit comments