Skip to content

Commit ec69207

Browse files
committed
improve when promo is displayed
1 parent 78f4819 commit ec69207

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

webui/.env

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
VITE_USE_DEMO=true
2-
VITE_DASHBOARD=true
3-
VITE_PROMO=true
2+
VITE_DASHBOARD=true

webui/.env.dashboard

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
VITE_WEBSITE=false
22
VITE_USE_DEMO=false
3-
VITE_DASHBOARD=true
4-
VITE_PROMO=false
3+
VITE_DASHBOARD=true

webui/src/components/Header.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { usePromo } from '@/composables/promo';
1212
1313
const isDashboard = import.meta.env.VITE_DASHBOARD === 'true'
1414
const useDemo = import.meta.env.VITE_USE_DEMO === 'true'
15-
const isPromoEnabled = import.meta.env.VITE_PROMO === 'true'
1615
const promo = usePromo()
1716
let appInfo: AppInfoResponse | null = null
1817
const query = ref('')
@@ -38,6 +37,11 @@ const levels = computed(() => {
3837
const visible = ref(false)
3938
4039
const router = useRouter()
40+
const isPromoEnabled = computed(() => {
41+
const disabled = ['dashboard', 'dashboard-demo']
42+
return !route.matched.some(r => disabled.includes(r.name?.toString() ?? ''));
43+
})
44+
4145
function switchTheme() {
4246
let theme = document.documentElement.getAttribute('data-theme');
4347
theme = theme == 'dark' ? 'light' : 'dark'

0 commit comments

Comments
 (0)