From 67e6b2f4a728faaa42f4287e6ce1139d1a310c3a Mon Sep 17 00:00:00 2001 From: Daniel Gorgonha Date: Mon, 3 Aug 2026 12:07:46 -0300 Subject: [PATCH] fix(ui): gate Meus cofres netMode with !IS_DEMO so demo + real share one origin With a hosted helper wired (VITE_HELPER_BASE), the /vaults home was showing the real /net vault list even in demo mode, since netMode keyed only on helperConfigured(). Gate it with !IS_DEMO so ?demo=1 keeps the mock demo vault while the real entry lists the device's browser-native (/net) vaults + DKG create. --- ui/src/screens/Vaults.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/src/screens/Vaults.tsx b/ui/src/screens/Vaults.tsx index df8ebc9..b87d681 100644 --- a/ui/src/screens/Vaults.tsx +++ b/ui/src/screens/Vaults.tsx @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react' import { useNavigate, Link } from 'react-router-dom' -import { getVaults, health, setSelectedVault, unlockVault, markVaultUnlocked, isVaultUnlocked, shortAddr, type Vault } from '../api' +import { getVaults, health, setSelectedVault, unlockVault, markVaultUnlocked, isVaultUnlocked, shortAddr, IS_DEMO, type Vault } from '../api' import { helperConfigured } from '../helper' import { listVaults, loadVault } from '../storage' import { setUnlockedShare } from '../session' @@ -25,7 +25,9 @@ export default function Vaults() { // Browser-native mode (a hosted blind helper is configured): the /vaults screen lists the vaults // THIS DEVICE holds a share for (from encrypted IndexedDB), never a global helper list, so one // device cannot enumerate another's vaults. Create/Enter route to the /net (Architecture B) flow. - const netMode = helperConfigured() + // Gated by `!IS_DEMO` so the SAME single build serves both worlds on one origin (issue #60): with a + // helper wired, `?demo=1` still shows the mock demo vault, while the real entry lists your /net vaults. + const netMode = helperConfigured() && !IS_DEMO const [vaults, setVaults] = useState([]) const [loaded, setLoaded] = useState(false) const [live, setLive] = useState(false)