fix prompt logic
This commit is contained in:
parent
936ac2f439
commit
d35f48a90e
1 changed files with 2 additions and 2 deletions
|
@ -8,7 +8,7 @@ import { SAVE } from '../../constants/confirmation_messages';
|
|||
|
||||
class PublishTool extends React.Component {
|
||||
render () {
|
||||
const {disabled, file, isUpdate, hasChanged, uri, status} = this.props;
|
||||
const {disabled, file, isUpdate, hasChanged, uri, status, location: currentLocation} = this.props;
|
||||
if (disabled) {
|
||||
return (
|
||||
<PublishDisabledMessage />
|
||||
|
@ -24,7 +24,7 @@ class PublishTool extends React.Component {
|
|||
<React.Fragment>
|
||||
<Prompt
|
||||
when={hasChanged}
|
||||
message={(location) => location.pathname === '/' ? true : SAVE}
|
||||
message={(location) => location.pathname === currentLocation.pathname ? false : SAVE}
|
||||
/>
|
||||
<PublishPreview isUpdate={isUpdate} uri={uri} />
|
||||
</React.Fragment>
|
||||
|
|
Loading…
Reference in a new issue