From 79ecf5d194b743dd3d936d55068da5f2a4bbb065 Mon Sep 17 00:00:00 2001 From: Pham Tu Date: Thu, 1 Feb 2024 10:00:01 +0700 Subject: [PATCH] disable paging for cosmwasm --- src/modules/[chain]/cosmwasm/WasmClient.ts | 4 +--- src/stores/useBaseStore.ts | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/modules/[chain]/cosmwasm/WasmClient.ts b/src/modules/[chain]/cosmwasm/WasmClient.ts index 1b9865b0..9b292856 100644 --- a/src/modules/[chain]/cosmwasm/WasmClient.ts +++ b/src/modules/[chain]/cosmwasm/WasmClient.ts @@ -120,9 +120,7 @@ export class WasmRestClient extends BaseRestClient { }; } - if (blockchain.chainName === 'osmosis') { - page?.setCountTotal(false); - } + page?.setCountTotal(false); const res = await this.queryClient.extra.listCode(page); return res; diff --git a/src/stores/useBaseStore.ts b/src/stores/useBaseStore.ts index 5e4d163b..5a6ff08f 100644 --- a/src/stores/useBaseStore.ts +++ b/src/stores/useBaseStore.ts @@ -107,10 +107,10 @@ export const useBaseStore = defineStore('baseStore', { } //check if the block exists in recents if ( - this.recents.findIndex( - (x) => - toBase64(x?.blockId?.hash) === toBase64(this.latest?.blockId?.hash) - ) === -1 + this.latest?.blockId?.hash && + this.recents.some( + (x) => toBase64(x.blockId.hash) === toBase64(this.latest.blockId.hash) + ) ) { if (this.recents.length >= 50) { this.recents.shift();