add case insensitive on chain name

This commit is contained in:
liangping 2022-08-05 06:24:36 +08:00
parent 5c46da6bfe
commit 2d73a3c72e
2 changed files with 3 additions and 3 deletions

View File

@ -385,13 +385,13 @@ const router = new VueRouter({
router.beforeEach((to, from, next) => {
const c = to.params.chain
if (c) {
store.commit('select', { chain_name: c })
store.commit('select', { chain_name: String(c).toLowerCase() })
store.dispatch('chains/getAllIBCDenoms', Vue.prototype)
}
const config = JSON.parse(localStorage.getItem('chains'))
// const has = Object.keys(config).findIndex(i => i === c)
if (!config || Object.keys(config).findIndex(i => i === c) > -1) {
if (!config || Object.keys(config).findIndex(i => i === String(c).toLowerCase()) > -1) {
next()
} else if (c) {
if (c === 'index.php') {

View File

@ -19,7 +19,7 @@ if (isTestnet()) {
const update = {}
configs.keys().forEach(k => {
const c = configs(k)
update[c.chain_name] = c
update[String(c.chain_name).toLowerCase()] = c
})
chains = update