Skip to content

Commit

Permalink
fix: welcome page condition (#736)
Browse files Browse the repository at this point in the history
Co-authored-by: Valentin Prugnaud <[email protected]>
  • Loading branch information
antfu and foxted authored Sep 23, 2024
1 parent 2256622 commit d23ce09
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/devtools/client/middleware/route.global.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { isFirstVisit } from '~/composables/storage'
import { telemetryEnabled } from '~/composables/telemetry'

export default defineNuxtRouteMiddleware((to) => {
if (to.path === '/' && !(isFirstVisit.value || telemetryEnabled.value == null))
if (isFirstVisit.value) {
if (to.path !== '/')
return navigateTo('/')
}
else if (to.path === '/') {
return navigateTo('/modules/overview')
else if (to.path !== '/' && telemetryEnabled.value == null)
return navigateTo('/')
}
})

0 comments on commit d23ce09

Please sign in to comment.