Return null if no wallet was found

This commit is contained in:
ekzyis 2024-07-19 08:20:00 -05:00
parent a0c1d4f602
commit 1b6de0bb96
2 changed files with 3 additions and 1 deletions

View File

@ -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 {

View File

@ -96,6 +96,8 @@ export function useWallet (name) {
}
}, [clearConfig, logger, disable])
if (!wallet) return null
return {
...wallet,
sendPayment,