From 1b6de0bb96a0909280eaec926f6473fc646afbb1 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Fri, 19 Jul 2024 08:20:00 -0500 Subject: [PATCH] Return null if no wallet was found --- components/payment.js | 2 +- wallets/index.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/components/payment.js b/components/payment.js index 08e35cc4..b156c357 100644 --- a/components/payment.js +++ b/components/payment.js @@ -131,7 +131,7 @@ export const useWalletPayment = () => { const wallet = useWallet() const waitForWalletPayment = useCallback(async ({ id, bolt11 }, waitFor) => { - if (!wallet?.enabled) { + if (!wallet) { throw new NoAttachedWalletError() } try { diff --git a/wallets/index.js b/wallets/index.js index 42b11b86..73ffe234 100644 --- a/wallets/index.js +++ b/wallets/index.js @@ -96,6 +96,8 @@ export function useWallet (name) { } }, [clearConfig, logger, disable]) + if (!wallet) return null + return { ...wallet, sendPayment,