From 2d73a3c72e791fcf0d8b09fef95f6e8fb053ec35 Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Fri, 5 Aug 2022 06:24:36 +0800 Subject: [PATCH] add case insensitive on chain name --- src/router/index.js | 4 ++-- src/store/chains/index.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index dd40ecc6..4f679fec 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -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') { diff --git a/src/store/chains/index.js b/src/store/chains/index.js index fd390d1f..d80782d5 100644 --- a/src/store/chains/index.js +++ b/src/store/chains/index.js @@ -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