Skip to content

Commit 6b2b79b

Browse files
committed
Fix errors from sentry
1 parent d6de001 commit 6b2b79b

File tree

3 files changed

+47
-47
lines changed

3 files changed

+47
-47
lines changed

components/modules/address/AddressOverview.vue

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ const handleSelect = (tab) => {
147147
148148
/** Pagination */
149149
const page = ref(1)
150+
const limit = 10
150151
const handleNextCondition = ref(true)
151152
const handleNext = () => {
152153
page.value += 1
@@ -332,8 +333,8 @@ const getTransactions = async () => {
332333
333334
const { data } = await fetchTxsByAddressHash({
334335
hash: props.address.hash,
335-
limit: 10,
336-
offset: (page.value - 1) * 10,
336+
limit: limit,
337+
offset: (page.value - 1) * limit,
337338
sort: sort.dir,
338339
sort_by: sort.by,
339340
status:
@@ -350,7 +351,7 @@ const getTransactions = async () => {
350351
351352
transactions.value = data.value
352353
cacheStore.current.transactions = transactions.value
353-
handleNextCondition.value = transactions.value.length < 10
354+
handleNextCondition.value = transactions.value?.length < limit
354355
355356
isRefetching.value = false
356357
}
@@ -360,14 +361,14 @@ const getMessages = async () => {
360361
361362
const { data } = await fetchMessagesByAddressHash({
362363
hash: props.address.hash,
363-
limit: 10,
364-
offset: (page.value - 1) * 10,
364+
limit: limit,
365+
offset: (page.value - 1) * limit,
365366
sort: "desc",
366367
})
367368
368369
messages.value = data.value
369370
cacheStore.current.messages = messages.value
370-
handleNextCondition.value = messages.value.length < 10
371+
handleNextCondition.value = messages.value?.length < limit
371372
372373
isRefetching.value = false
373374
}
@@ -377,15 +378,15 @@ const getBlobs = async () => {
377378
378379
const { data } = await fetchBlobsByAddressHash({
379380
hash: props.address.hash,
380-
limit: 10,
381-
offset: (page.value - 1) * 10,
381+
limit: limit,
382+
offset: (page.value - 1) * limit,
382383
sort: "desc",
383384
})
384385
385386
if (data.value?.length) {
386387
blobs.value = data.value.map((b) => ({ ...b, signer: props.address }))
387388
}
388-
handleNextCondition.value = data.value.length < 10
389+
handleNextCondition.value = data.value?.length < limit
389390
390391
isRefetching.value = false
391392
}
@@ -420,14 +421,14 @@ const getDelegations = async () => {
420421
421422
const { data } = await fetchAddressDelegations({
422423
hash: props.address.hash,
423-
limit: 10,
424-
offset: (page.value - 1) * 10,
424+
limit: limit,
425+
offset: (page.value - 1) * limit,
425426
})
426427
427428
if (data.value?.length) {
428429
delegations.value = data.value
429430
}
430-
handleNextCondition.value = data.value.length < 10
431+
handleNextCondition.value = data.value?.length < limit
431432
432433
isRefetching.value = false
433434
}
@@ -437,14 +438,14 @@ const getRedelegations = async () => {
437438
438439
const { data } = await fetchAddressRedelegations({
439440
hash: props.address.hash,
440-
limit: 10,
441-
offset: (page.value - 1) * 10,
441+
limit: limit,
442+
offset: (page.value - 1) * limit,
442443
})
443444
444445
if (data.value?.length) {
445446
redelegations.value = data.value
446447
}
447-
handleNextCondition.value = data.value.length < 10
448+
handleNextCondition.value = data.value?.length < limit
448449
449450
isRefetching.value = false
450451
}
@@ -454,14 +455,14 @@ const getUndelegations = async () => {
454455
455456
const { data } = await fetchAddressUndelegations({
456457
hash: props.address.hash,
457-
limit: 10,
458-
offset: (page.value - 1) * 10,
458+
limit: limit,
459+
offset: (page.value - 1) * limit,
459460
})
460461
461462
if (data.value?.length) {
462463
undelegations.value = data.value
463464
}
464-
handleNextCondition.value = data.value.length < 10
465+
handleNextCondition.value = data.value?.length < limit
465466
466467
isRefetching.value = false
467468
}
@@ -475,14 +476,14 @@ const getGrants = async () => {
475476
476477
const { data } = await fetchAddressGrants({
477478
hash: props.address.hash,
478-
limit: 10,
479-
offset: (page.value - 1) * 10,
479+
limit: limit,
480+
offset: (page.value - 1) * limit,
480481
})
481482
482483
if (data.value?.length) {
483484
grants.value = data.value
484485
}
485-
handleNextCondition.value = data.value.length < 10
486+
handleNextCondition.value = data.value?.length < limit
486487
487488
isRefetching.value = false
488489
}
@@ -492,14 +493,14 @@ const getGranters = async () => {
492493
493494
const { data } = await fetchAddressGranters({
494495
hash: props.address.hash,
495-
limit: 10,
496-
offset: (page.value - 1) * 10,
496+
limit: limit,
497+
offset: (page.value - 1) * limit,
497498
})
498499
499500
if (data.value?.length) {
500501
granters.value = data.value
501502
}
502-
handleNextCondition.value = data.value.length < 10
503+
handleNextCondition.value = data.value?.length < limit
503504
504505
isRefetching.value = false
505506
}
@@ -513,13 +514,13 @@ const getVestings = async () => {
513514
const { data } = await fetchAddressVestings({
514515
hash: props.address.hash,
515516
showEnded: showEnded.value,
516-
limit: 10,
517-
offset: (page.value - 1) * 10,
517+
limit: limit,
518+
offset: (page.value - 1) * limit,
518519
})
519520
520521
vestings.value = data.value
521522
522-
handleNextCondition.value = data.value.length < 10
523+
handleNextCondition.value = data.value?.length < limit
523524
524525
isRefetching.value = false
525526
}

components/modules/stats/TimelineSlider.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,19 +213,19 @@ const brushed = ({ selection, sourceEvent }) => {
213213
fixedX1Index = Math.floor(currentX / xBand.step())
214214
fixedX0Index = Math.floor(currentX / xBand.step())
215215
216-
fixedX0 = xBand(new Date(currentData[fixedX0Index].time).toISOString()) - padding
217-
fixedX1 = xBand(new Date(currentData[currentIndex].time).toISOString()) - padding + xBand.step()
216+
fixedX0 = xBand(new Date(currentData[fixedX0Index]?.time).toISOString()) - padding
217+
fixedX1 = xBand(new Date(currentData[currentIndex]?.time).toISOString()) - padding + xBand.step()
218218
}
219219
220220
if (fixedX0Index - currentIndex > 0) {
221-
fixedX0 = xBand(new Date(currentData[currentIndex].time).toISOString()) - padding
221+
fixedX0 = xBand(new Date(currentData[currentIndex]?.time).toISOString()) - padding
222222
setStartEndFromIndex(currentData, currentIndex, fixedX1Index)
223223
} else if (fixedX0Index - currentIndex < 0) {
224-
fixedX1 = xBand(new Date(currentData[currentIndex].time).toISOString()) - padding + xBand.step()
224+
fixedX1 = xBand(new Date(currentData[currentIndex]?.time).toISOString()) - padding + xBand.step()
225225
setStartEndFromIndex(currentData, fixedX0Index, currentIndex)
226226
} else {
227-
fixedX0 = xBand(new Date(currentData[currentIndex].time).toISOString()) - padding
228-
fixedX1 = xBand(new Date(currentData[currentIndex].time).toISOString()) - padding + xBand.step()
227+
fixedX0 = xBand(new Date(currentData[currentIndex]?.time).toISOString()) - padding
228+
fixedX1 = xBand(new Date(currentData[currentIndex]?.time).toISOString()) - padding + xBand.step()
229229
setStartEndFromIndex(currentData, currentIndex, currentIndex)
230230
}
231231
const newX0 = fixedX0

components/modules/validator/ValidatorOverview.vue

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const votes = ref([])
6262
const uptime = ref([])
6363
6464
const page = ref(1)
65+
const limit = 10
6566
const handleNextCondition = ref(true)
6667
6768
const handleNext = () => {
@@ -76,14 +77,14 @@ const getBlocks = async () => {
7677
7778
const { data } = await fetchValidatorBlocks({
7879
id: props.validator.id,
79-
limit: 10,
80-
offset: (page.value - 1) * 10,
80+
limit: limit,
81+
offset: (page.value - 1) * limit,
8182
})
8283
8384
if (data.value?.length) {
8485
blocks.value = data.value
8586
cacheStore.current.blocks = blocks.value
86-
handleNextCondition.value = blocks.value.length < 10
87+
handleNextCondition.value = blocks.value?.length < limit
8788
}
8889
8990
isRefetching.value = false
@@ -94,12 +95,12 @@ const getDelegators = async () => {
9495
9596
const { data } = await fetchValidatorDelegators({
9697
id: props.validator.id,
97-
limit: 10,
98-
offset: (page.value - 1) * 10,
98+
limit: limit,
99+
offset: (page.value - 1) * limit,
99100
})
100101
101102
delegators.value = data.value
102-
handleNextCondition.value = delegators.value.length < 10
103+
handleNextCondition.value = delegators.value?.length < limit
103104
104105
isRefetching.value = false
105106
}
@@ -109,12 +110,12 @@ const getJails = async () => {
109110
110111
const { data } = await fetchValidatorJails({
111112
id: props.validator.id,
112-
limit: 10,
113-
offset: (page.value - 1) * 10,
113+
limit: limit,
114+
offset: (page.value - 1) * limit,
114115
})
115116
116117
jails.value = data.value
117-
handleNextCondition.value = jails.value.length < 10
118+
handleNextCondition.value = jails.value?.length < limit
118119
119120
isRefetching.value = false
120121
}
@@ -124,12 +125,12 @@ const getVotes = async () => {
124125
125126
const { data } = await fetchVotesByAddressHash({
126127
hash: props.validator.delegator?.hash,
127-
limit: 10,
128-
offset: (page.value - 1) * 10,
128+
limit: limit,
129+
offset: (page.value - 1) * limit,
129130
})
130131
131132
votes.value = data.value
132-
handleNextCondition.value = votes.value.length < 10
133+
handleNextCondition.value = votes.value?.length < limit
133134
134135
isRefetching.value = false
135136
}
@@ -571,8 +572,6 @@ const handleDelegate = () => {
571572
}
572573
573574
.uptime {
574-
/* width: 10px;
575-
height: 10px; */
576575
width: 0.6rem;
577576
height: 0.6rem;
578577

0 commit comments

Comments
 (0)