Skip to content

Commit

Permalink
Update routes, disable checksum
Browse files Browse the repository at this point in the history
  • Loading branch information
emiliorizzo committed Mar 11, 2020
1 parent 1ee3b94 commit 3bba3ce
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import store from '../store/'
import Router from 'vue-router'
import routes from './routes'
import { normalizeSearch } from '../lib/js/utils'
import { isValidAddress } from 'rsk-utils/dist/addresses'
// import { isValidAddress } from 'rsk-utils/dist/addresses'
import { ROUTES as r } from '../config/types'

Vue.use(Router)
Expand Down Expand Up @@ -53,17 +53,13 @@ router.afterEach((to, from) => {
* Navigation guard for all routes
*/
function checkBeforeEnter (to, from, next) {
let chainId = store.getters.chainId
// let chainId = store.getters.chainId
let { params } = Object.assign({}, to)
let { address, hash } = params
if (hash) params.hash = normalizeSearch(hash)
if (!isCheckAddressPath(to) && address) {
if (!isValidAddress(address, chainId)) {
next(`/${r.checkAddress}/${address}`)
} else {
to.params.address = normalizeSearch(address)
next()
}
to.params.address = normalizeSearch(address)
next()
} else {
next()
}
Expand Down

0 comments on commit 3bba3ce

Please sign in to comment.