Skip to content

Commit

Permalink
Fixed Bug 51806 - Client.Files. Fixed error after clicking on the loc…
Browse files Browse the repository at this point in the history
…k icon
  • Loading branch information
gopienkonikita committed Dec 27, 2021
1 parent 37ee77d commit 829fba7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 6 additions & 4 deletions products/ASC.Files/Client/src/HOCs/withBadges.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ import config from "../../package.json";

export default function withBadges(WrappedComponent) {
class WithBadges extends React.Component {
state = { isLoading: false };

onClickLock = () => {
const { item, lockFileAction, isAdmin, setIsLoading } = this.props;
const { item, lockFileAction, isAdmin } = this.props;
const { locked, id, access } = item;

if (isAdmin || access === 0) {
setIsLoading(true);
if ((isAdmin || access === 0) && !this.state.isLoading) {
this.setState({ isLoading: true });
return lockFileAction(id, !locked)
.catch((err) => toastr.error(err))
.finally(() => setIsLoading(false));
.finally(() => this.setState({ isLoading: false }));
}
return;
};
Expand Down
4 changes: 3 additions & 1 deletion products/ASC.Files/Client/src/HOCs/withFileActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ export default function withFileActions(WrappedFileItem) {
if (encrypted && isPrivacy) return checkProtocol(item.id, true);

if (isTrashFolder) return;
if (e && e.target.tagName === "INPUT") return;
if ((e && e.target.tagName === "INPUT") || !!e.target.closest(".badges"))
return;

e.preventDefault();

if (isFolder) {
Expand Down

0 comments on commit 829fba7

Please sign in to comment.