11import { put , select , takeLatest } from 'redux-saga/effects'
2- import { LOCATION_CHANGE , replace } from 'connected-react-router '
2+ import { LOCATION_CHANGE , replace } from 'redux-first-history '
33import { isEmpty } from '@bitfinex/lib-js-util-base'
44
55import { getTarget } from 'state/query/utils'
@@ -14,11 +14,15 @@ import { getLastRoute, getRouteParams } from './selectors'
1414
1515const { MENU_ORDER_TRADES } = queryConstants
1616
17+ let isFirstRendering = true
18+
1719function * locationChange ( { payload } ) {
18- const { isFirstRendering , location } = payload
20+ const { location } = payload
1921 const { pathname, search, state } = location
2022
21- if ( isFirstRendering ) {
23+ const isFirstRender = isFirstRendering
24+ if ( isFirstRender ) {
25+ isFirstRendering = false
2226 // redirects from legacy sections `deposits' and 'withdrawals' to 'movements' on first render
2327 if ( pathname . includes ( '/deposits' ) || pathname . includes ( '/withdrawals' ) ) {
2428 const [ , , symbols ] = pathname . split ( '/' )
@@ -43,7 +47,7 @@ function* locationChange({ payload }) {
4347 }
4448
4549 // return previously saved params on route change
46- if ( route !== lastRoute && ! isFirstRendering ) {
50+ if ( route !== lastRoute && ! isFirstRender ) {
4751 const routeParams = yield select ( getRouteParams , route )
4852 if ( isEmpty ( routeParams ) ) {
4953 const query = getQueryWithoutParams ( Object . keys ( FILTER_KEYS ) ) // remove filters of current section
0 commit comments