We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3750e4 commit 5618c28Copy full SHA for 5618c28
client/modules/App/App.jsx
@@ -36,12 +36,11 @@ const App = ({ children, location }) => {
36
const previousLocationRef = useRef(location);
37
useEffect(() => {
38
const prevLocation = previousLocationRef.current;
39
- const locationChanged =
40
- prevLocation && prevLocation.pathname !== location.pathname;
+ const locationChanged = prevLocation && prevLocation !== location;
41
const shouldSkipRemembering = location.state?.skipSavingPath === true;
42
43
if (locationChanged && !shouldSkipRemembering) {
44
- dispatch(setPreviousPath(location.pathname));
+ dispatch(setPreviousPath(prevLocation.pathname));
45
}
46
previousLocationRef.current = location;
47
}, [location]);
0 commit comments