Update BlueComponents.js

This commit is contained in:
marcosrdz 2020-11-28 10:04:46 -05:00
parent 7781f0c05b
commit b1dd6a6bf4

View file

@ -1673,21 +1673,27 @@ export const BlueTransactionListItem = React.memo(({ item, itemPriceUnit = Bitco
} }
}); });
if (lightningWallet.length === 1) { if (lightningWallet.length === 1) {
// is it a successful lnurl-pay? try {
const LN = new Lnurl(false, AsyncStorage); // is it a successful lnurl-pay?
let paymentHash = item.payment_hash; const LN = new Lnurl(false, AsyncStorage);
if (typeof paymentHash === 'object') { let paymentHash = item.payment_hash;
paymentHash = Buffer.from(paymentHash.data).toString('hex'); if (typeof paymentHash === 'object') {
} paymentHash = Buffer.from(paymentHash.data).toString('hex');
const loaded = await LN.loadSuccessfulPayment(paymentHash); }
if (loaded) { const loaded = await LN.loadSuccessfulPayment(paymentHash);
navigate('ScanLndInvoiceRoot', { if (loaded) {
screen: 'LnurlPaySuccess', NavigationService.navigate('ScanLndInvoiceRoot', {
paymentHash, screen: 'LnurlPaySuccess',
justPaid: false, params: {
fromWalletID: lightningWallet[0].getID(), paymentHash,
}); justPaid: false,
return; fromWalletID: lightningWallet[0].getID(),
},
});
return;
}
} catch (e) {
console.log(e);
} }
navigate('LNDViewInvoice', { navigate('LNDViewInvoice', {