Web: People|Files: Added timeout for 500 ms on setup "isLoading" flag (for quickly responses)
This commit is contained in:
parent
7cb9affc77
commit
ee76d58ee8
@ -41,6 +41,7 @@ class FilesStore {
|
|||||||
selection = [];
|
selection = [];
|
||||||
selected = "close";
|
selected = "close";
|
||||||
filter = FilesFilter.getDefault(); //TODO: FILTER
|
filter = FilesFilter.getDefault(); //TODO: FILTER
|
||||||
|
loadTimeout = null;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
authStore,
|
authStore,
|
||||||
@ -77,7 +78,15 @@ class FilesStore {
|
|||||||
};
|
};
|
||||||
|
|
||||||
setIsLoading = (isLoading) => {
|
setIsLoading = (isLoading) => {
|
||||||
|
if (isLoading) {
|
||||||
|
this.loadTimeout && clearTimeout(this.loadTimeout);
|
||||||
|
this.loadTimeout = setTimeout(() => {
|
||||||
this.isLoading = isLoading;
|
this.isLoading = isLoading;
|
||||||
|
}, 500);
|
||||||
|
} else {
|
||||||
|
this.loadTimeout && clearTimeout(this.loadTimeout);
|
||||||
|
this.isLoading = isLoading;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
setTooltipPosition = (tooltipPageX, tooltipPageY) => {
|
setTooltipPosition = (tooltipPageX, tooltipPageY) => {
|
||||||
|
@ -31,6 +31,7 @@ class PeopleStore {
|
|||||||
isLoaded = false;
|
isLoaded = false;
|
||||||
isRefresh = false;
|
isRefresh = false;
|
||||||
isInit = false;
|
isInit = false;
|
||||||
|
loadTimeout = null;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.groupsStore = new GroupsStore(this);
|
this.groupsStore = new GroupsStore(this);
|
||||||
@ -77,8 +78,16 @@ class PeopleStore {
|
|||||||
this.setIsLoaded(true);
|
this.setIsLoaded(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
setIsLoading = (loading) => {
|
setIsLoading = (isLoading) => {
|
||||||
this.isLoading = loading;
|
if (isLoading) {
|
||||||
|
this.loadTimeout && clearTimeout(this.loadTimeout);
|
||||||
|
this.loadTimeout = setTimeout(() => {
|
||||||
|
this.isLoading = isLoading;
|
||||||
|
}, 500);
|
||||||
|
} else {
|
||||||
|
this.loadTimeout && clearTimeout(this.loadTimeout);
|
||||||
|
this.isLoading = isLoading;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
setIsLoaded = (isLoaded) => {
|
setIsLoaded = (isLoaded) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user