fix denoms

This commit is contained in:
donne1226 2022-04-06 22:03:40 +08:00
parent a8a3a202eb
commit edb48bc4c4
3 changed files with 8 additions and 4 deletions

View File

@ -328,9 +328,9 @@ export default class ChainFetch {
const conf = config || this.getSelectedConfig() const conf = config || this.getSelectedConfig()
const sdkVersion = conf.sdk_version const sdkVersion = conf.sdk_version
if (compareVersions(sdkVersion, '0.44.2') < 0) { 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) { async getIBCDenomTrace(hash, config = null) {

View File

@ -360,7 +360,11 @@ const router = new VueRouter({
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
const c = to.params.chain 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 config = JSON.parse(localStorage.getItem('chains'))
// const has = Object.keys(config).findIndex(i => i === c) // const has = Object.keys(config).findIndex(i => i === c)

View File

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