From d23ce0993d1baa0cdd119a86429d2f6271410887 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Mon, 23 Sep 2024 20:52:51 +0200 Subject: [PATCH] fix: welcome page condition (#736) Co-authored-by: Valentin Prugnaud --- packages/devtools/client/middleware/route.global.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/devtools/client/middleware/route.global.ts b/packages/devtools/client/middleware/route.global.ts index c9db38014..76f9b5e9b 100644 --- a/packages/devtools/client/middleware/route.global.ts +++ b/packages/devtools/client/middleware/route.global.ts @@ -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('/') + } })