Fixed infinite loop if no users, no domains, or no records are present
This commit is contained in:
parent
14039932fe
commit
25346304f5
|
@ -49,7 +49,7 @@ export class DomainsComponent implements OnInit {
|
||||||
|
|
||||||
const res = await this.domains.getList(this.pageRequested, this.gs.pageSize, searchStr, sortStr, typeFilter);
|
const res = await this.domains.getList(this.pageRequested, this.gs.pageSize, searchStr, sortStr, typeFilter);
|
||||||
|
|
||||||
if (res.paging.total < this.pageRequested) {
|
if (res.paging.total < this.pageRequested && res.paging.total > 0) {
|
||||||
this.pageRequested = Math.max(1, res.paging.total);
|
this.pageRequested = Math.max(1, res.paging.total);
|
||||||
await this.loadData();
|
await this.loadData();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -119,7 +119,7 @@ export class EditAuthComponent implements OnInit {
|
||||||
const res = await this.records.getListForDomain(this.domainId, this.pageRequested,
|
const res = await this.records.getListForDomain(this.domainId, this.pageRequested,
|
||||||
this.gs.pageSize, queryName, typeFilter, queryContent, sortStr);
|
this.gs.pageSize, queryName, typeFilter, queryContent, sortStr);
|
||||||
|
|
||||||
if (res.paging.total < this.pageRequested) {
|
if (res.paging.total < this.pageRequested && res.paging.total > 0) {
|
||||||
this.pageRequested = Math.max(1, res.paging.total);
|
this.pageRequested = Math.max(1, res.paging.total);
|
||||||
await this.loadRecords();
|
await this.loadRecords();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -49,7 +49,7 @@ export class UsersComponent implements OnInit {
|
||||||
|
|
||||||
const res = await this.users.getList(this.pageRequested, this.gs.pageSize, searchStr, sortStr, typeFilter);
|
const res = await this.users.getList(this.pageRequested, this.gs.pageSize, searchStr, sortStr, typeFilter);
|
||||||
|
|
||||||
if (res.paging.total < this.pageRequested) {
|
if (res.paging.total < this.pageRequested && res.paging.total > 0) {
|
||||||
this.pageRequested = Math.max(1, res.paging.total);
|
this.pageRequested = Math.max(1, res.paging.total);
|
||||||
await this.loadData();
|
await this.loadData();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue