Return null if no wallet was found
This commit is contained in:
parent
a0c1d4f602
commit
1b6de0bb96
|
@ -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 {
|
||||
|
|
|
@ -96,6 +96,8 @@ export function useWallet (name) {
|
|||
}
|
||||
}, [clearConfig, logger, disable])
|
||||
|
||||
if (!wallet) return null
|
||||
|
||||
return {
|
||||
...wallet,
|
||||
sendPayment,
|
||||
|
|
Loading…
Reference in New Issue