feat: handle user cancellation in zap process
This commit is contained in:
parent
5e3cd04280
commit
094ccd92da
3 changed files with 14 additions and 5 deletions
|
|
@ -48,7 +48,7 @@ class LightningService {
|
|||
comment: string,
|
||||
eventId?: string,
|
||||
closeOuterModel?: () => void
|
||||
): Promise<{ preimage: string; invoice: string }> {
|
||||
): Promise<{ preimage: string; invoice: string } | null> {
|
||||
if (!client.signer) {
|
||||
throw new Error('You need to be logged in to zap')
|
||||
}
|
||||
|
|
@ -112,6 +112,7 @@ class LightningService {
|
|||
onCancelled: () => {
|
||||
clearInterval(checkPaymentInterval)
|
||||
subCloser?.close()
|
||||
resolve(null)
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue