Skip to content

Commit

Permalink
Fix: pagination of constant reference contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Aug 3, 2022
1 parent 8aafe0f commit f451be6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/views/constant/ReferenceContract.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<v-skeleton-loader :loading="loading" type="article" transition="fade-transition">
<v-data-table
:items="contracts"
v-if="contracts.length"
v-if="!isEmpty"
hide-default-header
:class="['ba-1 mt-4 avg-gas-consumption', 'hide-pagination-count']"
hide-default-footer
Expand Down Expand Up @@ -76,6 +76,7 @@ export default {
isLastPage: true,
itemsPerPage: 10,
page: 0,
isEmpty: true
}
},
async mounted() {
Expand All @@ -87,8 +88,10 @@ export default {
const offset = this.page * this.itemsPerPage;
const {network, address} = this.$route.params;
this.contracts = await this.api.getConstantsByAddress(network, address, offset);
this.isLastPage = this.contracts.length < this.itemsPerPage
let contracts = await this.api.getConstantsByAddress(network, address, offset);
this.isLastPage = contracts.length < this.itemsPerPage;
this.isEmpty = contracts.length === 0 && this.contracts.length === 0;
this.contracts = contracts;
await this.getAliases(network);
Expand Down

0 comments on commit f451be6

Please sign in to comment.