Skip to content

Commit

Permalink
improved @jondubois solution the vue way
Browse files Browse the repository at this point in the history
  • Loading branch information
maarteNNNN committed Nov 2, 2021
1 parent 515728b commit 7c6e07b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/views/Delegates.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ export default {
const votes = ref([]);
const delegateCount = ref(null);
const recentForgers = ref(null);
const slotCount = computed(
() => delegateCount.value * DELEGATE_ACTIVITY_ROUNDS,
);
const columns = ref([
{
Expand Down Expand Up @@ -142,12 +145,10 @@ export default {
await store.client.value.getForgingDelegates()
).length;
let slotCount = delegateCount.value * DELEGATE_ACTIVITY_ROUNDS;
let latestBlocks = await store.client.value.getBlocksBetweenHeights(
Math.max(0, maxBlockHeight.value - slotCount),
const latestBlocks = await store.client.value.getBlocksBetweenHeights(
Math.max(0, maxBlockHeight.value - slotCount.value),
maxBlockHeight.value,
slotCount,
slotCount.value,
);
recentForgers.value = new Set(
Expand Down

0 comments on commit 7c6e07b

Please sign in to comment.