fix race calling open before wallet-rpc ready

This commit is contained in:
2026-08-02 14:26:49 +08:00
parent af6251669a
commit 4270d380fb
3 changed files with 6 additions and 15 deletions
@@ -101,6 +101,11 @@ export const MoneroWallet = () => {
if (installed && !running) {
await start()
await checkStatus()
} else if (startInFlight) {
// a start is already in flight (e.g. triggered by init);
// wait for it so we don't call open before the server is up
await startInFlight.catch(() => {})
await checkStatus()
}
if (!running) {
error = 'Wallet server failed to start. Please try again.'
-14
View File
@@ -127,20 +127,6 @@
}
})
// Self-heal: if the monero wallet list never got loaded (e.g. the server
// was starting while the dashboard rendered), retry login once.
$effect(() => {
if (
moneroWallet.ready &&
!moneroWallet.walletOpen &&
!moneroWallet.opening &&
moneroWallet.wallets.length === 0 &&
!moneroWallet.error
) {
void moneroWallet.login()
}
})
$effect(() => {
if (moneroWallet.walletOpen) {
fetchXmr()