[ADF-5263] Empty page displayed all the time when load content fix (#6209)

* Make test run on API update
Improve create librrary test

* Fix empty page displayed always first

* remvoe console

* fix

* fix

* lint

* fix

* fix

* fix

* fix

* fix
This commit is contained in:
Eugenio Romano
2020-10-05 00:26:56 +01:00
committed by GitHub
parent d128bc158c
commit 04f5fdffd7
27 changed files with 174 additions and 179 deletions

View File

@@ -481,18 +481,8 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
}
}
if (changes['currentFolderId']?.currentValue !== changes['currentFolderId']?.previousValue) {
if (this.data) {
this.data.loadPage(null, false, null, this.getPreselectNodesBasedOnSelectionMode());
this.onPreselectNodes();
this.resetNewFolderPagination();
}
if (changes['currentFolderId'].currentValue) {
this.loadFolder();
}
if (this.currentFolderId && changes['currentFolderId']?.currentValue !== changes['currentFolderId']?.previousValue) {
this.loadFolder();
}
if (this.data) {
@@ -659,14 +649,19 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
}
private setLoadingState(value: boolean) {
if (value) {
clearTimeout(this.loadingTimeout);
this.loadingTimeout = setTimeout(() => {
this.loading = true;
}, 1000);
if (this.data?.getRows().length > 0) {
if (value) {
clearTimeout(this.loadingTimeout);
this.loadingTimeout = setTimeout(() => {
this.loading = true;
}, 1000);
} else {
clearTimeout(this.loadingTimeout);
this.loading = false;
}
} else {
clearTimeout(this.loadingTimeout);
this.loading = false;
this.loading = value;
}
}