Backend: - Add --add-host host.containers.internal:host-gateway to LND and Bitcoin Knots containers (fixes DNS resolution failure in rootless podman) - Add --user 0:0 and DAC_OVERRIDE to nginx UI sidecar containers (fixes chown crash in rootless podman for bitcoin-ui, electrs-ui, lnd-ui) - Add hostadd to Rust Podman API client for web UI container installs - Add Chromium privacy flags to kiosk launcher (disable telemetry) Frontend: - Fix onboarding reset on raw IP visits (trust localStorage as first-class signal, skip boot screen when server is up but not onboarded) - Fix seed regression: persist challenge indices in sessionStorage so going back from Verify doesn't change which words are asked - Remove glass container from seed Generate/Verify/Restore screens - Add Back button to Restore from Seed screen - Replace Network card: Tor (purple), VPN status (orange), Bitcoin sync (orange) - Add ElectrumX to curated app list with correct .webp icon - Install flow: navigate to My Apps immediately with toast, hide installed/installing apps from marketplace and discover views Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
33 lines
1.2 KiB
TypeScript
33 lines
1.2 KiB
TypeScript
/**
|
|
* Onboarding state - prefers backend, falls back to localStorage for mock/offline.
|
|
* Hardened: retries on 502/503, never blocks completion.
|
|
*/
|
|
import { rpcClient } from '@/api/rpc-client'
|
|
|
|
async function callWithRetry<T>(fn: () => Promise<T>, maxRetries = 3): Promise<T | null> {
|
|
for (let i = 0; i < maxRetries; i++) {
|
|
try {
|
|
return await fn()
|
|
} catch (e) {
|
|
const msg = e instanceof Error ? e.message : ''
|
|
const isRetryable = /502|503|timeout|fetch|network/i.test(msg)
|
|
if (!isRetryable || i === maxRetries - 1) return null
|
|
await new Promise((r) => setTimeout(r, 800 * (i + 1)))
|
|
}
|
|
}
|
|
return null
|
|
}
|
|
|
|
export async function isOnboardingComplete(): Promise<boolean> {
|
|
// localStorage is set on completion and survives backend restarts/resets
|
|
if (localStorage.getItem('neode_onboarding_complete') === '1') return true
|
|
const result = await callWithRetry(() => rpcClient.isOnboardingComplete(), 2)
|
|
if (result !== null) return result
|
|
return false
|
|
}
|
|
|
|
export async function completeOnboarding(): Promise<void> {
|
|
await callWithRetry(() => rpcClient.completeOnboarding(), 3)
|
|
localStorage.setItem('neode_onboarding_complete', '1')
|
|
}
|