Fix all wallets deleted on logout (#1308)

Every wallet returned by the useWallet hook has sendPayment set even if it doesn't support payments since wallet.sendPayment is wrapped with a useCallback hook.
This commit is contained in:
ekzyis 2024-08-16 15:50:11 -05:00 committed by GitHub
parent 3cd9991aa9
commit ab80873a57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -105,6 +105,7 @@ export function useWallet (name) {
return {
...wallet,
canSend: !!wallet.sendPayment,
sendPayment,
config,
save,
@ -375,7 +376,7 @@ export function useWallets () {
const resetClient = useCallback(async (wallet) => {
for (const w of wallets) {
if (w.sendPayment) {
if (w.canSend) {
await w.delete()
}
await w.deleteLogs()