require auth to log in (lock screen), remove auth-on-logout, remove welcome card from multicoin dashboard, relocate login buttons to root welcome page

- login('multi') no longer silently loads seed from keychain — shows locked screen with Touch ID/password
- Removed welcome card from EvmDashboard (multicoin route), root / handles account selection
- Root welcome page buttons call w.login() before navigating to respective routes
- Monero welcome page buttons also call w.login() before navigating
- logout now simply calls w.logout() + navigate('/') with no auth required
- Removed tab-bar logout buttons; logout moved to wallet card alongside refresh/settings/stop
This commit is contained in:
2026-05-18 05:24:08 +08:00
parent 6142b27c49
commit 9846e6464d
4 changed files with 9 additions and 45 deletions
@@ -84,32 +84,7 @@
{#if !w.ready}
<div class="mx-auto mt-16 max-w-md text-center text-muted-foreground text-sm">Loading...</div>
{:else if !w.accountType}
<div class="mx-auto mt-24 max-w-sm">
<Card>
<CardHeader class="text-center">
<CardTitle>Welcome</CardTitle>
<CardDescription>Choose an account type to get started</CardDescription>
</CardHeader>
<CardContent>
<div class="flex flex-col gap-3">
<Button
onclick={() => w.login('multi')}
class="w-full">
Multi Coins (ETH / BSC / Polygon)
</Button>
<Button
onclick={() => navigate('/monero')}
variant="outline"
class="w-full">
Monero
</Button>
</div>
</CardContent>
</Card>
</div>
{:else if w.accountType === 'multi'}
{#if !w.vaultExists}
{:else if !w.vaultExists}
<Card>
<CardHeader>
<CardTitle>Import Wallet</CardTitle>
@@ -192,11 +167,6 @@
{net.name}
</button>
{/each}
<button
class="cursor-pointer rounded-md px-2.5 py-1 text-xs font-medium transition-colors bg-muted text-muted-foreground hover:bg-muted/80"
onclick={() => w.logout()}>
Logout
</button>
</div>
<Card>
@@ -291,8 +261,8 @@
<Button variant="outline" onclick={() => navigate('/settings')}>
<SettingsIcon size={16} />
</Button>
<Button variant="outline" onclick={() => w.lock()}>
Lock
<Button variant="outline" onclick={() => { w.logout(); navigate('/') }}>
Logout
</Button>
</div>
</CardContent>
@@ -417,4 +387,3 @@
</Card>
</div>
{/if}
{/if}
@@ -132,9 +132,6 @@ export const Wallet = () => {
const login = async (type: AccountType) => {
accountType = type
if (type === 'multi') {
if (!seed && vaultExists) {
await loadSeed()
}
if (seed) await switchNetwork(network)
} else if (type === 'monero') {
if (moneroInstalled && !moneroRunning) {
+2 -2
View File
@@ -33,12 +33,12 @@
<CardContent>
<div class="flex flex-col gap-3">
<Button
onclick={() => navigate('/multicoin')}
onclick={async () => { await w.login('multi'); navigate('/multicoin') }}
class="w-full">
Multi Coins (ETH / BSC / Polygon)
</Button>
<Button
onclick={() => navigate('/monero')}
onclick={async () => { await w.login('monero'); navigate('/monero') }}
variant="outline"
class="w-full">
Monero
+4 -6
View File
@@ -48,7 +48,7 @@
<CardContent>
<div class="flex flex-col gap-3">
<Button
onclick={() => navigate('/multicoin')}
onclick={async () => { await w.login('multi'); navigate('/multicoin') }}
variant="outline"
class="w-full">
Multi Coins (ETH / BSC / Polygon)
@@ -67,11 +67,6 @@
class="cursor-pointer rounded-md px-2.5 py-1 text-xs font-medium transition-colors bg-primary text-primary-foreground">
Monero
</button>
<button
class="cursor-pointer rounded-md px-2.5 py-1 text-xs font-medium transition-colors bg-muted text-muted-foreground hover:bg-muted/80"
onclick={() => w.logout()}>
Logout
</button>
</div>
{#if w.moneroDownloading}
@@ -214,6 +209,9 @@
<Button variant="outline" onclick={() => w.moneroStop()}>
Stop
</Button>
<Button variant="outline" onclick={() => { w.logout(); navigate('/') }}>
Logout
</Button>
</div>
</CardContent>
</Card>