Skip to content

Commit

Permalink
Avoid calling next more than once when navigating from / to /errata
Browse files Browse the repository at this point in the history
  • Loading branch information
javihernandez committed Feb 14, 2025
1 parent d394c51 commit fa0e4eb
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/router/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ const routes = [
name: 'BuildFeed',
component: () => import('pages/BuildFeed.vue'),
beforeEnter(to, from, next) {
store.dispatch('users/loadUsersList').then(next()).catch(next())
store
.dispatch('platforms/loadPlatformList')
.then(next())
.catch(next())
Promise.all([
store.dispatch('users/loadUsersList'),
store.dispatch('platforms/loadPlatformList'),
]).finally(() => next())
},
children: [
{
Expand Down Expand Up @@ -98,10 +97,7 @@ const routes = [
path: 'errata',
component: () => import('pages/ErrataFeed.vue'),
beforeEnter(to, from, next) {
store
.dispatch('platforms/loadPlatformList')
.then(next())
.catch(next())
store.dispatch('platforms/loadPlatformList').then(next)
},
},
{
Expand Down

0 comments on commit fa0e4eb

Please sign in to comment.