Merge pull request #107 from donne1226/save-IBCDenoms-to-Store

fix denoms
This commit is contained in:
ping 2022-04-07 12:53:58 +08:00 committed by GitHub
commit bcb10125ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -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) {

View File

@ -360,7 +360,10 @@ const router = new VueRouter({
router.beforeEach((to, from, next) => {
const c = to.params.chain
if (c) store.commit('select', { chain_name: c })
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)

View File

@ -72,7 +72,7 @@ export default {
}
},
setIBCDenoms(state, denoms) {
state.denoms = denoms
state.denoms = { ...state.denoms, ...denoms }
},
setIBCPaths(state, paths) {
state.ibcPaths = paths