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 {
|
class PublishTool extends React.Component {
|
||||||
render () {
|
render () {
|
||||||
const {disabled, file, isUpdate, hasChanged, uri, status} = this.props;
|
const {disabled, file, isUpdate, hasChanged, uri, status, location: currentLocation} = this.props;
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
return (
|
return (
|
||||||
<PublishDisabledMessage />
|
<PublishDisabledMessage />
|
||||||
|
@ -24,7 +24,7 @@ class PublishTool extends React.Component {
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Prompt
|
<Prompt
|
||||||
when={hasChanged}
|
when={hasChanged}
|
||||||
message={(location) => location.pathname === '/' ? true : SAVE}
|
message={(location) => location.pathname === currentLocation.pathname ? false : SAVE}
|
||||||
/>
|
/>
|
||||||
<PublishPreview isUpdate={isUpdate} uri={uri} />
|
<PublishPreview isUpdate={isUpdate} uri={uri} />
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
|
|
Loading…
Add table
Reference in a new issue