From edb48bc4c4477ab58f6bda2448b688857b343adc Mon Sep 17 00:00:00 2001 From: donne1226 <503124742@qq.com> Date: Wed, 6 Apr 2022 22:03:40 +0800 Subject: [PATCH 1/2] fix denoms --- src/libs/fetch.js | 4 ++-- src/router/index.js | 6 +++++- src/store/chains/index.js | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/libs/fetch.js b/src/libs/fetch.js index 445eef49..6c74a17c 100644 --- a/src/libs/fetch.js +++ b/src/libs/fetch.js @@ -328,9 +328,9 @@ export default class ChainFetch { const conf = config || this.getSelectedConfig() const sdkVersion = conf.sdk_version if (compareVersions(sdkVersion, '0.44.2') < 0) { - return this.get('/ibc/applications/transfer/v1beta1/denom_traces?pagination.limit=500', config).then(data => commonProcess(data)) + return this.get('/ibc/applications/transfer/v1beta1/denom_traces?pagination.limit=500', conf).then(data => commonProcess(data)) } - return this.get('/ibc/apps/transfer/v1/denom_traces?pagination.limit=500', config).then(data => commonProcess(data)) + return this.get('/ibc/apps/transfer/v1/denom_traces?pagination.limit=500', conf).then(data => commonProcess(data)) } async getIBCDenomTrace(hash, config = null) { diff --git a/src/router/index.js b/src/router/index.js index 6bd28144..cbfd7168 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -360,7 +360,11 @@ const router = new VueRouter({ router.beforeEach((to, from, next) => { const c = to.params.chain - if (c) store.commit('select', { chain_name: c }) + console.log(Vue.prototype) + if (c) { + store.commit('select', { chain_name: c }) + store.dispatch('chains/getAllIBCDenoms', Vue.prototype) + } const config = JSON.parse(localStorage.getItem('chains')) // const has = Object.keys(config).findIndex(i => i === c) diff --git a/src/store/chains/index.js b/src/store/chains/index.js index 1e92d8a5..fd390d1f 100644 --- a/src/store/chains/index.js +++ b/src/store/chains/index.js @@ -72,7 +72,7 @@ export default { } }, setIBCDenoms(state, denoms) { - state.denoms = denoms + state.denoms = { ...state.denoms, ...denoms } }, setIBCPaths(state, paths) { state.ibcPaths = paths From 95a099445d64983b50ecf6d7169e40074d9f4a76 Mon Sep 17 00:00:00 2001 From: donne1226 <503124742@qq.com> Date: Wed, 6 Apr 2022 22:04:57 +0800 Subject: [PATCH 2/2] fix --- src/router/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/router/index.js b/src/router/index.js index cbfd7168..aa2baafe 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -360,7 +360,6 @@ const router = new VueRouter({ router.beforeEach((to, from, next) => { const c = to.params.chain - console.log(Vue.prototype) if (c) { store.commit('select', { chain_name: c }) store.dispatch('chains/getAllIBCDenoms', Vue.prototype)