forked from cerc-io/cosmos-explorer
add alias support
This commit is contained in:
parent
ebad319fcd
commit
bc25fce1cc
@ -1,5 +1,6 @@
|
||||
{
|
||||
"chain_name": "akash-network",
|
||||
"chain_name": "akash",
|
||||
"alias": "akash-network",
|
||||
"api": ["https://akash.c29r3.xyz:443/api", "https://akash.api.ping.pub"],
|
||||
"rpc": ["http://rpc.akash.forbole.com:80", "http://akashsentry01.skynetvalidators.com:26657"],
|
||||
"snapshot_provider": "",
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"chain_name": "band-protocol",
|
||||
"chain_name": "band",
|
||||
"alias": "band-protocol",
|
||||
"api": "https://laozi1.bandchain.org/api",
|
||||
"rpc": ["http://rpc.laozi1.bandchain.org:80", "http://rpc.laozi1.bandchain.org:80"],
|
||||
"snapshot_provider": "",
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"chain_name": "iris-network",
|
||||
"chain_name": "iris",
|
||||
"alias": "iris-network",
|
||||
"api": "https://iris.api.ping.pub",
|
||||
"rpc": ["http://34.82.96.8:26657","http://34.77.68.145:26657"],
|
||||
"snapshot_provider": "fcc1d9bc43163b20ce5163cf41a302b33f25375f@34.82.96.8:26656",
|
||||
|
@ -403,14 +403,14 @@ const router = new VueRouter({
|
||||
})
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
const c = to.params.chain
|
||||
if (c) {
|
||||
store.commit('select', { chain_name: String(c).toLowerCase() })
|
||||
}
|
||||
const c = String(to.params.chain).toLowerCase()
|
||||
|
||||
const config = JSON.parse(localStorage.getItem('chains'))
|
||||
// const has = Object.keys(config).findIndex(i => i === c)
|
||||
if (!config || Object.keys(config).findIndex(i => i === String(c).toLowerCase()) > -1) {
|
||||
const configs = JSON.parse(localStorage.getItem('chains'))
|
||||
const conf = Object.values(configs).find(i => i.chain_name === c || i.alias === c)
|
||||
if (!configs || conf) {
|
||||
if (conf) {
|
||||
store.commit('select', { chain_name: conf.chain_name })
|
||||
}
|
||||
next()
|
||||
} else if (c) {
|
||||
if (c === 'index.php') {
|
||||
|
Loading…
Reference in New Issue
Block a user