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

Commit 05ec835

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

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+
// Stop if we're already at the right location and this isn't
116+
// a new change
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)