Merge pull request #1288 from ONLYOFFICE/bugfix/fixed-loader-blinking
Web: Client: added a small delay to the loader so that there is no fl…
This commit is contained in:
commit
32b4bc6afd
@ -50,10 +50,17 @@ const ArticleBodyContent = (props) => {
|
||||
|
||||
const [disableBadgeClick, setDisableBadgeClick] = React.useState(false);
|
||||
|
||||
let loadTimeout = null;
|
||||
|
||||
const campaigns = (localStorage.getItem("campaigns") || "")
|
||||
.split(",")
|
||||
.filter((campaign) => campaign.length > 0);
|
||||
|
||||
const cleanTimer = () => {
|
||||
loadTimeout && clearTimeout(loadTimeout);
|
||||
loadTimeout = null;
|
||||
};
|
||||
|
||||
const onClick = React.useCallback(
|
||||
(folderId) => {
|
||||
const {
|
||||
@ -72,7 +79,9 @@ const ArticleBodyContent = (props) => {
|
||||
const filesSection = window.location.pathname.indexOf("/filter") > 0;
|
||||
|
||||
if (filesSection) {
|
||||
setIsLoading(true);
|
||||
loadTimeout = setTimeout(() => {
|
||||
setIsLoading(true);
|
||||
}, 200);
|
||||
} else {
|
||||
showLoader();
|
||||
}
|
||||
@ -88,6 +97,7 @@ const ArticleBodyContent = (props) => {
|
||||
|
||||
fetchRooms(folderId, filter).finally(() => {
|
||||
if (filesSection) {
|
||||
cleanTimer();
|
||||
setIsLoading(false);
|
||||
} else {
|
||||
hideLoader();
|
||||
|
Loading…
Reference in New Issue
Block a user