Skip to content

Commit

Permalink
Fix paging on smart contract list view
Browse files Browse the repository at this point in the history
  • Loading branch information
dangershony committed Feb 23, 2022
1 parent 8cca32e commit d97841c
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class ContractAddressComponent implements OnInit, OnDestroy {
}

try {
await this.updateTransactions('/api/query/cirrus/contract/' + id + '/transactions?limit=' + this.limit);
await this.updateTransactions('/api/query/cirrus/contract/' + id + '/transactions?offset=&limit=' + this.limit);
} catch (err) {
if (err.message[0] === '{') {
this.errorTransactions = JSON.parse(err.message);
Expand Down Expand Up @@ -114,6 +114,19 @@ export class ContractAddressComponent implements OnInit, OnDestroy {
}
}

list.sort((b, a) => {
if (a.blockIndex === b.blockIndex) {
return 0;
}
if (a.blockIndex < b.blockIndex) {
return -1;
}
if (a.blockIndex > b.blockIndex) {
return 1;
}
});


this.total = response.headers.get('Pagination-Total');
const linkHeader = response.headers.get('Link');
const links = this.api.parseLinkHeader(linkHeader);
Expand Down

0 comments on commit d97841c

Please sign in to comment.