Skip to content

Commit

Permalink
Web: Files: fix isUpdated sharing panel
Browse files Browse the repository at this point in the history
  • Loading branch information
vafomin committed Nov 2, 2021
1 parent 42dab36 commit b5c506b
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class SharingPanelComponent extends React.Component {
this.setState({
shareDataItems: newDataItems,
showEmbeddingContent: false,
isUpdated: !isUpdated,
isUpdated: true,
});
};

Expand Down Expand Up @@ -215,8 +215,12 @@ class SharingPanelComponent extends React.Component {
.catch((err) => toastr.error(err))
.finally(() => setIsLoading(false));
};

onNotifyUsersChange = () =>
this.setState({ isNotifyUsers: !this.state.isNotifyUsers });
this.setState({
isNotifyUsers: !this.state.isNotifyUsers,
isUpdated: true,
});

onShowUsersPanel = () =>
this.setState({
Expand All @@ -232,7 +236,7 @@ class SharingPanelComponent extends React.Component {

if (elem.access !== +access) {
elem.access = +access;
this.setState({ shareDataItems: shareDataItems, isUpdated: true });
this.setState({ shareDataItems, isUpdated: true });
}
};

Expand All @@ -243,7 +247,7 @@ class SharingPanelComponent extends React.Component {
const index = shareDataItems.findIndex((x) => x.sharedTo.id === id);
if (index !== -1) {
shareDataItems.splice(index, 1);
this.setState({ shareDataItems });
this.setState({ shareDataItems, isUpdated: true });
}
};

Expand Down Expand Up @@ -348,7 +352,8 @@ class SharingPanelComponent extends React.Component {

onChangeMessage = (e) => this.setState({ message: e.target.value });

setShareDataItems = (shareDataItems) => this.setState({ shareDataItems });
setShareDataItems = (shareDataItems) =>
this.setState({ shareDataItems, isUpdated: true });

onClose = () => {
const {
Expand Down

0 comments on commit b5c506b

Please sign in to comment.