From 2567aea4be0ae9ba8bca2db4ee09463b57d6023e Mon Sep 17 00:00:00 2001 From: Techno Freak Date: Wed, 7 Feb 2024 02:13:29 +0300 Subject: [PATCH] Fix IBC fetch from registry --- src/modules/[chain]/ibc/connStore.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/modules/[chain]/ibc/connStore.ts b/src/modules/[chain]/ibc/connStore.ts index 6d6bdf42..aa63c5f4 100644 --- a/src/modules/[chain]/ibc/connStore.ts +++ b/src/modules/[chain]/ibc/connStore.ts @@ -42,10 +42,14 @@ export const useIBCModule = defineStore('module-ibc', { fetchConnection(path: string) { const client = new ChainRegistryClient(); client.fetchIBCPathInfo(path).then(res => { - const connId = res.chain_1.chain_name === this.chain.current?.prettyName || this.chain.chainName ? - res.chain_1.connection_id : res.chain_2.connection_id - this.registryConf = res - this.showConnection(connId) + const isFirstChain = res.chain_1.chain_name === this.chain.current?.prettyName || res.chain_1.chain_name === this.chain.chainName; + + const connId = isFirstChain + ? res.chain_1.connection_id + : res.chain_2.connection_id; + + this.registryConf = res; + this.showConnection(connId); }) }, showConnection(connId?: string | number) {