Skip to content

Commit

Permalink
Fix bug 53335: disable button in sharing panel
Browse files Browse the repository at this point in the history
  • Loading branch information
vafomin committed Oct 27, 2021
1 parent 1a5e098 commit 361e6bc
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class SharingPanelComponent extends React.Component {
accessOptions: [],
filesOwnerId: null,
showEmbeddingContent: false,
isUpdated: false,
};

this.ref = React.createRef();
Expand All @@ -70,7 +71,7 @@ class SharingPanelComponent extends React.Component {
};

onToggleLink = (item) => {
const { shareDataItems } = this.state;
const { shareDataItems, isUpdated } = this.state;
const { DenyAccess, ReadOnly } = ShareAccessRights;

const rights = item.access !== DenyAccess ? DenyAccess : ReadOnly;
Expand All @@ -80,6 +81,7 @@ class SharingPanelComponent extends React.Component {
this.setState({
shareDataItems: newDataItems,
showEmbeddingContent: false,
isUpdated: !isUpdated,
});
};

Expand Down Expand Up @@ -231,6 +233,7 @@ class SharingPanelComponent extends React.Component {
if (elem.access !== +access) {
elem.access = +access;
this.setState({ shareDataItems });
this.setState({ isUpdated: true });
}
};

Expand Down Expand Up @@ -434,6 +437,7 @@ class SharingPanelComponent extends React.Component {
accessOptions,
externalAccessOptions,
showEmbeddingContent,
isUpdated,
} = this.state;

const visible = sharingPanelVisible;
Expand Down Expand Up @@ -501,7 +505,7 @@ class SharingPanelComponent extends React.Component {
size="big"
primary
onClick={this.onSaveClick}
isDisabled={isLoading}
isDisabled={isLoading || !isUpdated}
/>
</ModalDialog.Footer>
</ModalDialog>
Expand Down

0 comments on commit 361e6bc

Please sign in to comment.