diff --git a/packages/asc-web-common/components/FloatingButton/FloatingButton.js b/packages/asc-web-common/components/FloatingButton/FloatingButton.js index 8554d88959..54dfe19277 100644 --- a/packages/asc-web-common/components/FloatingButton/FloatingButton.js +++ b/packages/asc-web-common/components/FloatingButton/FloatingButton.js @@ -25,6 +25,8 @@ import CloseIcon from "../../../../public/images/close-icon.react.svg"; const StyledButtonAlertIcon = styled(ButtonAlertIcon)` ${commonIconsStyles} `; + +const Delay = 1000; const FloatingButton = ({ id, className, style, ...rest }) => { const { icon, @@ -41,14 +43,17 @@ const FloatingButton = ({ id, className, style, ...rest }) => { clearUploadedFilesHistory && clearUploadedFilesHistory(); }; + let timerId = null; + useEffect(() => { - if (percent === 100) { - setTimeout(() => { - setAnimationCompleted(true); - }, 1000); - } else { - setAnimationCompleted(false); - } + timerId = setTimeout( + () => setAnimationCompleted(percent === 100 ? true : false), + Delay + ); + + return () => { + clearTimeout(timerId); + }; }, [percent, setAnimationCompleted]); return ( diff --git a/products/ASC.Files/Client/src/store/ContextOptionsStore.js b/products/ASC.Files/Client/src/store/ContextOptionsStore.js index f1cd0c2b68..8dd6236ebd 100644 --- a/products/ASC.Files/Client/src/store/ContextOptionsStore.js +++ b/products/ASC.Files/Client/src/store/ContextOptionsStore.js @@ -631,6 +631,7 @@ class ContextOptionsStore { }; getGroupContextOptions = (t) => { + const { personal } = this.authStore.settingsStore; const { selection } = this.filesStore; const { setDeleteDialogVisible } = this.dialogsStore; const { isRecycleBinFolder } = this.treeFoldersStore; @@ -639,9 +640,10 @@ class ContextOptionsStore { selection.findIndex((k) => k.contextOptions.includes("download-as")) !== -1; - const sharingItems = selection.filter( - (k) => k.contextOptions.includes("sharing-settings") && k.canShare - ).length; + const sharingItems = + selection.filter( + (k) => k.contextOptions.includes("sharing-settings") && k.canShare + ).length && !personal; const favoriteItems = selection.filter((k) => k.contextOptions.includes("mark-as-favorite")