global singleton wallet state with single bootstrap in layout

This commit is contained in:
2026-08-02 18:59:31 +08:00
parent 20f29faa80
commit 7b4ba84fee
7 changed files with 52 additions and 49 deletions
@@ -24,8 +24,6 @@
let unlocking = $state(false)
let unlockError = $state('')
let initStarted = false
async function unlockWithPassword() {
if (unlocking || !walletPassword.trim()) return
unlocking = true
@@ -48,16 +46,6 @@
}
})
$effect(() => {
if (!initStarted) {
initStarted = true
w.init().then(async () => {
if (w.accountType === 'monero') return
await w.login()
})
}
})
$effect(() => {
if (w.running && !w.walletOpen && w.wallets.length > 0 && !w.loading && !w.opening) {
w.autoUnlock(w.wallets[0])