Skip to content

Commit

Permalink
fix: once
Browse files Browse the repository at this point in the history
  • Loading branch information
cgilbe27 committed May 23, 2024
1 parent cf79114 commit 1cc3d85
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { setupLayouts } from 'virtual:generated-layouts';
// @ts-ignore
import routes from '~pages';

let once = false;

const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [...setupLayouts(routes)],
Expand All @@ -13,8 +15,9 @@ const router = createRouter({
//update current blockchain
router.beforeEach((to) => {
console.log(to);
if (to.path === '/') {
if (to.path === '/' && !once) {
window.location.replace('/nibiru');
once = true;
}

const { chain } = to.params;
Expand Down

0 comments on commit 1cc3d85

Please sign in to comment.