Do not set prevPath if navigation passes through skipSavingPath flag
This commit is contained in:
parent
443232380c
commit
1b461d33cf
1 changed files with 4 additions and 1 deletions
|
@ -18,7 +18,10 @@ class App extends React.Component {
|
|||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.location !== this.props.location) {
|
||||
const locationWillChange = nextProps.location !== this.props.location;
|
||||
const shouldSkipRemembering = nextProps.location.state && nextProps.location.state.skipSavingPath === true;
|
||||
|
||||
if (locationWillChange && !shouldSkipRemembering) {
|
||||
this.props.setPreviousPath(this.props.location.pathname);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue