@@ -147,6 +147,7 @@ const handleSelect = (tab) => {
147147
148148/** Pagination */
149149const page = ref (1 )
150+ const limit = 10
150151const handleNextCondition = ref (true )
151152const 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}
0 commit comments