fix race calling open before wallet-rpc ready
This commit is contained in:
@@ -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.'
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user