Skip to content

Commit 5618c28

Browse files
committed
Fix previousPath handling.
1 parent b3750e4 commit 5618c28

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

client/modules/App/App.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,11 @@ const App = ({ children, location }) => {
3636
const previousLocationRef = useRef(location);
3737
useEffect(() => {
3838
const prevLocation = previousLocationRef.current;
39-
const locationChanged =
40-
prevLocation && prevLocation.pathname !== location.pathname;
39+
const locationChanged = prevLocation && prevLocation !== location;
4140
const shouldSkipRemembering = location.state?.skipSavingPath === true;
4241

4342
if (locationChanged && !shouldSkipRemembering) {
44-
dispatch(setPreviousPath(location.pathname));
43+
dispatch(setPreviousPath(prevLocation.pathname));
4544
}
4645
previousLocationRef.current = location;
4746
}, [location]);

0 commit comments

Comments
 (0)