Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
posva authored Nov 17, 2023
1 parent ffeadc0 commit b382a4f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/composables/guards.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ export function onBeforeRouteLeave (guard) {
}

function registerGuard (router, guard, fn, depth) {
return router.beforeEach((to, from, next) => {
return fn(to, from, depth) ? guard(to, from, next) : next()
})
return router.beforeEach((to, from, next) =>
fn(to, from, depth) ? guard(to, from, next) : next()
)
}

const noop = () => {}
Expand Down Expand Up @@ -70,7 +70,7 @@ function useFilteredGuard (guard, fn) {
})
onDeactivated(() => {
removeGuard()
removeGuard = null // reset removeGuard
removeGuard = null
})

return removeGuard
Expand Down

0 comments on commit b382a4f

Please sign in to comment.