Skip to content
This repository was archived by the owner on Oct 26, 2018. It is now read-only.

Commit ab7b481

Browse files
committed
Clean up location check
1 parent 4091b1e commit ab7b481

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,12 @@ function syncReduxAndRouter(history, store, selectRouterState = SELECT_STATE) {
112112
routing = firstRoute;
113113
}
114114

115-
if(lastRoute !== undefined && lastRoute.changeId === routing.changeId) {
116-
if(locationsAreEqual(routing, lastRoute)) return;
115+
// Only trigger history update is this is a new change or the location
116+
// has changed.
117+
if(lastRoute !== undefined &&
118+
lastRoute.changeId === routing.changeId &&
119+
locationsAreEqual(lastRoute, routing)) {
120+
return;
117121
}
118122

119123
lastRoute = routing;

0 commit comments

Comments
 (0)