Skip to content

Commit b1f6e65

Browse files
committed
fix(send): show confetti for pending payment success
1 parent c106b2f commit b1f6e65

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/utils/lightning/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ import {
102102
import { showToast } from '../notifications';
103103
import i18n from '../i18n';
104104
import { bitkitLedger, syncLedger } from '../ledger';
105+
import { sendNavigation } from '../../navigation/bottom-sheet/SendNavigation';
105106

106107
const PAYMENT_TIMEOUT = 8 * 1000; // 8 seconds
107108

@@ -492,6 +493,14 @@ export const subscribeToLightningPayments = ({
492493
title: i18n.t('wallet:toast_payment_success_title'),
493494
description: i18n.t('wallet:toast_payment_success_description'),
494495
});
496+
497+
// If the send sheet is open, navigate to the success screen
498+
sendNavigation.navigate('Success', {
499+
type: EActivityType.lightning,
500+
txId: found.payment_hash,
501+
amount: found.amount,
502+
});
503+
495504
await refreshLdk();
496505
bitkitLedger?.handleLNTx({ ...res, amount_sat: found.amount });
497506
} else {
@@ -508,7 +517,7 @@ export const subscribeToLightningPayments = ({
508517
const found = pending.find((p) => p.payment_hash === res.payment_hash);
509518

510519
if (found) {
511-
await refreshLdk({ selectedWallet, selectedNetwork });
520+
await refreshLdk();
512521
showToast({
513522
type: 'error',
514523
title: i18n.t('wallet:toast_payment_failed_title'),

0 commit comments

Comments
 (0)