diff --git a/products/ASC.Files/Client/src/components/panels/UploadPanel/LoadingButton.js b/products/ASC.Files/Client/src/components/panels/UploadPanel/LoadingButton.js index 04a4c9cdf13..caebf3671c2 100644 --- a/products/ASC.Files/Client/src/components/panels/UploadPanel/LoadingButton.js +++ b/products/ASC.Files/Client/src/components/panels/UploadPanel/LoadingButton.js @@ -1,4 +1,4 @@ -import React from "react"; +import React, { useState } from "react"; import styled, { css, keyframes } from "styled-components"; import globalColors from "@appserver/components/utils/globalColors"; @@ -32,7 +32,7 @@ const StyledCircle = styled.div` } ${(props) => - props.percent === 0 + props.percent === 0 || (props.isAnimation && props.inConversion) ? css` .circle__fill { animation: ${rotate360} 2s linear infinite; @@ -86,6 +86,13 @@ const StyledLoadingButton = styled.div` const LoadingButton = ({ id, className, style, ...rest }) => { const { percent, onClick, isConversion, inConversion } = rest; + const [isAnimation, setIsAnimation] = useState(true); + + const stopAnimation = () => { + setIsAnimation(false); + }; + + setTimeout(stopAnimation, 5000); return ( { style={style} onClick={onClick} > - +