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 wallet = useWallet()
|
||||||
|
|
||||||
const waitForWalletPayment = useCallback(async ({ id, bolt11 }, waitFor) => {
|
const waitForWalletPayment = useCallback(async ({ id, bolt11 }, waitFor) => {
|
||||||
if (!wallet?.enabled) {
|
if (!wallet) {
|
||||||
throw new NoAttachedWalletError()
|
throw new NoAttachedWalletError()
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -96,6 +96,8 @@ export function useWallet (name) {
|
||||||
}
|
}
|
||||||
}, [clearConfig, logger, disable])
|
}, [clearConfig, logger, disable])
|
||||||
|
|
||||||
|
if (!wallet) return null
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...wallet,
|
...wallet,
|
||||||
sendPayment,
|
sendPayment,
|
||||||
|
|
Loading…
Reference in New Issue