fix(ui): wire Meus cofres to the real /net flow (demo-gated netMode) - #87
Merged
Conversation
…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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On
konclave-demo, clicking Meus cofres shows the demo vault and Criar cofre opens the demo/local form, even with demo off. Vaults created on the (now-deleted)net-previewdomain don't appear.Root cause: the
/vaultshome keysnetModeonhelperConfigured()alone.konclave-demonever hadVITE_HELPER_BASEset (onlyVITE_RELAY_BASE), sonetMode=false→ the screen falls back toMOCK(the "Tesouraria Comum" demo vault) and create → local/create. net-preview hadVITE_HELPER_BASE, which is why the real /net flow worked there.Fix (two parts)
1. Code (this PR): gate
netMode = helperConfigured() && !IS_DEMOinVaults.tsx. So once the helper is wired on one origin,?demo=1still shows the mock demo vault while the real entry lists the device's browser-native (/net) vaults and "Criar cofre" opens the DKG flow. Without this, wiring the helper would break the demo (it'd show an empty real list).2. Config (ops, not in this PR): set
VITE_HELPER_BASE=https://konclave-helper-production.up.railway.apponkonclave-demo(prod + preview). The hosted helper (/api/health→ 200) and relay are both live.Note
IndexedDB is per-origin. Vaults created on
konclave-net-preview.vercel.appdo not carry tokonclave-demo.vercel.app(different origin; net-preview deleted) — a fresh vault must be created on the consolidated origin.Verification
pnpm -C ui build— typecheck + build clean.helperunit tests pass.IS_NET(Dashboard/Ledger/Proposals) already carry&& !DEMO;/net(NetVault) is always the real flow by design — unchanged.