diff --git a/screen/wallets/transactions.js b/screen/wallets/transactions.js index 0b4605774..0a279498b 100644 --- a/screen/wallets/transactions.js +++ b/screen/wallets/transactions.js @@ -107,6 +107,7 @@ export default class WalletTransactions extends Component { */ getTransactions(limit = Infinity) { let wallet = this.props.navigation.getParam('wallet'); + let txs = wallet.getTransactions(); for (let tx of txs) { tx.sort_ts = +new Date(tx.received); @@ -131,7 +132,7 @@ export default class WalletTransactions extends Component { isLightning() { let w = this.state.wallet; - if (w && w.type === LightningCustodianWallet.type) { + if (w && w.chain === Chain.OFFCHAIN) { return true; } @@ -201,7 +202,21 @@ export default class WalletTransactions extends Component { renderListHeaderComponent = () => { return ( - + + + {/* + So the idea here, due to Apple banning native Lapp marketplace, is: + On Android everythins works as it worked before. Single "Marketplace" button that leads to LappBrowser that + opens /marketplace/ url of offchain wallet type, and /marketplace-btc/ for onchain. + On iOS its more complicated - we have one button that opens same page _externally_ (in Safari), and second + button that opens actual LappBrowser but with _blank_ page. This is important to not trigger Apple. + Blank page is also the way Trust Wallet does it with Dapp Browser. + + For ONCHAIN wallet type no LappBrowser button should be displayed, its Lightning-network specific. + */} + {this.renderMarketplaceButton()} + {this.state.wallet.type === LightningCustodianWallet.type && Platform.OS === 'ios' && this.renderLappBrowserButton()} + this.setState({ isManageFundsModalVisible: true })} /> - - - {/* - So the idea here, due to Apple banning native Lapp marketplace, is: - On Android everythins works as it worked before. Single "Marketplace" button that leads to LappBrowser that - opens /marketplace/ url of offchain wallet type, and /marketplace-btc/ for onchain. - On iOS its more complicated - we have one button that opens same page _externally_ (in Safari), and second - button that opens actual LappBrowser but with _blank_ page. This is important to not trigger Apple. - Blank page is also the way Trust Wallet does it with Dapp Browser. - - For ONCHAIN wallet type no LappBrowser button should be displayed, its Lightning-network specific. - */} - {this.renderMarketplaceButton()} - {this.state.wallet.type === LightningCustodianWallet.type && Platform.OS === 'ios' && this.renderLappBrowserButton()} - + { + onEndReached={async () => { // pagination in works. in this block we will add more txs to flatlist // so as user scrolls closer to bottom it will render mode transactions @@ -452,7 +454,6 @@ export default class WalletTransactions extends Component { pageSize: this.state.pageSize * 2, }); }} - ListHeaderComponent={this.renderListHeaderComponent} ListFooterComponent={this.renderListFooterComponent} ListEmptyComponent={ @@ -527,7 +528,7 @@ export default class WalletTransactions extends Component { return ( { - if (this.state.wallet.type === LightningCustodianWallet.type) { + if (this.state.wallet.chain === Chain.OFFCHAIN) { navigate('LNDCreateInvoice', { fromWallet: this.state.wallet }); } else { navigate('ReceiveDetails', { secret: this.state.wallet.getSecret() }); @@ -543,7 +544,7 @@ export default class WalletTransactions extends Component { return ( { - if (this.state.wallet.type === LightningCustodianWallet.type) { + if (this.state.wallet.chain === Chain.OFFCHAIN) { navigate('ScanLndInvoice', { fromSecret: this.state.wallet.getSecret() }); } else { navigate('SendDetails', {