From 30ada2f85c04b4075eb42357c3808125dcb667f7 Mon Sep 17 00:00:00 2001 From: Daniel Gorgonha Date: Mon, 3 Aug 2026 01:11:29 -0300 Subject: [PATCH] fix(ui): show 'Exit demo' only when a real mode exists (a helper is configured) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On a pure demo deploy (VITE_DEMO=1, no helper) exiting demo lands on an empty backend, so the exit link is misleading. Render it only when helperConfigured() — the canonical build (helper wired) still offers it. --- ui/src/components.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ui/src/components.tsx b/ui/src/components.tsx index db38242..520a70c 100644 --- a/ui/src/components.tsx +++ b/ui/src/components.tsx @@ -3,10 +3,12 @@ import { Link } from 'react-router-dom' import { useReveal } from './reveal' import { useI18n, useT } from './i18n' import { IS_DEMO } from './api' +import { helperConfigured } from './helper' /** A thin, always-visible strip in demo mode (runtime `?demo=1` or the VITE_DEMO fallback) so a - * visitor never mistakes the sample data for a real vault, and can leave demo mode (`?demo=0`). - * Renders nothing outside demo mode. */ + * visitor never mistakes the sample data for a real vault. Offers "Exit demo" (`?demo=0`) ONLY when + * a real mode exists to exit to (a helper is configured) — a pure demo deploy has nowhere to go, so + * the exit would land on an empty backend. Renders nothing outside demo mode. */ export function DemoBanner() { const t = useT() if (!IS_DEMO) return null @@ -14,7 +16,7 @@ export function DemoBanner() {
DEMO {t('demo.bannerNote')} - {t('demo.bannerExit')} + {helperConfigured() && {t('demo.bannerExit')}}
) }