From 6eb8dbfeca4d237ce5d95e2c5ad1436bb698957c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Rodriguez=20Ve=CC=81lez?= Date: Sat, 5 Jan 2019 04:51:25 -0500 Subject: [PATCH] FIX: Cannot click on Lightning transactions #196 --- ios/BlueWallet/Info.plist | 2 +- screen/wallets/list.js | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ios/BlueWallet/Info.plist b/ios/BlueWallet/Info.plist index 02f58905..6d52103e 100644 --- a/ios/BlueWallet/Info.plist +++ b/ios/BlueWallet/Info.plist @@ -33,7 +33,7 @@ CFBundleVersion - 208 + 210 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/screen/wallets/list.js b/screen/wallets/list.js index 1c0ccc5b..802f292c 100644 --- a/screen/wallets/list.js +++ b/screen/wallets/list.js @@ -20,6 +20,7 @@ import { NavigationEvents } from 'react-navigation'; import ReactNativeHapticFeedback from 'react-native-haptic-feedback'; import PropTypes from 'prop-types'; import { BitcoinUnit } from '../../models/bitcoinUnits'; +import { LightningCustodianWallet } from '../../class'; let EV = require('../../events'); let A = require('../../analytics'); /** @type {AppStorage} */ @@ -413,11 +414,20 @@ export default class WalletsList extends Component { navigate('TransactionDetails', { hash: rowData.item.hash, }); - } else if (rowData.item.type === 'user_invoice') { - // this.props.navigation.navigate('LNDViewInvoice', { - // invoice: rowData.item, - // fromWallet: this.state.wallets[this.state.lastSnappedTo], - // }); + } else if ( + rowData.item.type === 'user_invoice' || + rowData.item.type === 'payment_request' || + rowData.item.type === 'paid_invoice' + ) { + const lightningWallet = this.state.wallets.filter(wallet => wallet.type === LightningCustodianWallet.type); + if (typeof lightningWallet === 'object') { + if (lightningWallet.length === 1) { + this.props.navigation.navigate('LNDViewInvoice', { + invoice: rowData.item, + fromWallet: lightningWallet[0], + }); + } + } } }} badge={{