Skip to content

Commit

Permalink
feat: if user has any site, redirect to site list instead of welcome
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmoysrt committed Sep 2, 2024
1 parent fcc0672 commit 78a736c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions dashboard/src2/pages/Welcome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export default {
window.$team = $team;
if ($team.doc.onboarding.complete && $team.doc.onboarding.site_created) {
next({ name: 'Site List' });
} else if (to.query.is_redirect && $team.doc.onboarding.site_created) {
next({ name: 'Site List' });
} else {
next();
}
Expand Down
9 changes: 8 additions & 1 deletion dashboard/src2/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ let router = createRouter({
path: '/',
name: 'Home',
component: () => import('./pages/Home.vue'),
redirect: { name: 'Welcome' }
beforeEnter: (to, from, next) => {
next({
name: 'Welcome',
query: {
is_redirect: true
}
});
}
},
{
path: '/welcome',
Expand Down

0 comments on commit 78a736c

Please sign in to comment.