import './storageFallback' import { StrictMode, useState, type FormEvent } from 'react' import { createRoot } from 'react-dom/client' import './index.css' import './styles/greenteaspeak.css' import './App.css' import { LanguageProvider, useT } from './i18n' import { discardVault, hasVault, unlockVault } from './vault' const root = createRoot(document.getElementById('root')!) // App reads its stored identities/favorites while loading, so it's imported only after the vault is open. async function start() { const { default: App } = await import('./App.tsx') root.render( , ) } function Unlock() { const t = useT() const [password, setPassword] = useState('') const [wrong, setWrong] = useState(false) const [busy, setBusy] = useState(false) const submit = async (e: FormEvent) => { e.preventDefault() setBusy(true) if (await unlockVault(password)) return void start() setBusy(false) setWrong(true) } return (

{t('vault.title')}

{t('vault.prompt')}

setPassword(e.target.value)} /> {wrong &&

{t('vault.wrong')}

}
) } if (hasVault()) root.render( , ) else void start()