refactor document dirty and empty logic

This commit is contained in:
thenanyu
2019-07-06 21:45:50 -07:00
parent ccc0906b0a
commit dea6085a11
4 changed files with 21 additions and 20 deletions

View File

@@ -30,6 +30,7 @@ type Props = {
isEditing: boolean,
isSaving: boolean,
isPublishing: boolean,
publishingIsDisabled: boolean,
savingIsDisabled: boolean,
onDiscard: () => *,
onSave: ({
@@ -99,6 +100,7 @@ class Header extends React.Component<Props> {
isPublishing,
isSaving,
savingIsDisabled,
publishingIsDisabled,
auth,
} = this.props;
const canShareDocuments =
@@ -171,7 +173,7 @@ class Header extends React.Component<Props> {
<Button
onClick={this.handlePublish}
title="Publish document"
disabled={savingIsDisabled}
disabled={publishingIsDisabled}
small
>
{isPublishing ? 'Publishing…' : 'Publish'}