From ab7b481006176dee754951976887ad9cc59ea690 Mon Sep 17 00:00:00 2001 From: Kim Joar Bekkelund Date: Sat, 5 Dec 2015 19:18:20 +0100 Subject: [PATCH] Clean up location check --- src/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index b8816cf..0b33e7b 100644 --- a/src/index.js +++ b/src/index.js @@ -112,8 +112,12 @@ function syncReduxAndRouter(history, store, selectRouterState = SELECT_STATE) { routing = firstRoute; } - if(lastRoute !== undefined && lastRoute.changeId === routing.changeId) { - if(locationsAreEqual(routing, lastRoute)) return; + // Only trigger history update is this is a new change or the location + // has changed. + if(lastRoute !== undefined && + lastRoute.changeId === routing.changeId && + locationsAreEqual(lastRoute, routing)) { + return; } lastRoute = routing;