Merge pull request #542 from freak12techno/fix-ibc-fetch-from-registry

Fix IBC fetch from registry
This commit is contained in:
ping 2024-02-09 11:23:44 +08:00 committed by GitHub
commit 23d43543cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -42,10 +42,14 @@ export const useIBCModule = defineStore('module-ibc', {
fetchConnection(path: string) { fetchConnection(path: string) {
const client = new ChainRegistryClient(); const client = new ChainRegistryClient();
client.fetchIBCPathInfo(path).then(res => { client.fetchIBCPathInfo(path).then(res => {
const connId = res.chain_1.chain_name === this.chain.current?.prettyName || this.chain.chainName ? const isFirstChain = res.chain_1.chain_name === this.chain.current?.prettyName || res.chain_1.chain_name === this.chain.chainName;
res.chain_1.connection_id : res.chain_2.connection_id
this.registryConf = res const connId = isFirstChain
this.showConnection(connId) ? res.chain_1.connection_id
: res.chain_2.connection_id;
this.registryConf = res;
this.showConnection(connId);
}) })
}, },
showConnection(connId?: string | number) { showConnection(connId?: string | number) {