Browse Source

REF: fix lapp browser on android

master
ncoelho 5 years ago
committed by Overtorment
parent
commit
a3c24eb127
  1. 24
      screen/wallets/transactions.js

24
screen/wallets/transactions.js

@ -219,13 +219,18 @@ export default class WalletTransactions extends Component {
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<View style={{ flexDirection: 'row', margin: 16, justifyContent: 'space-evenly' }}> <View style={{ flexDirection: 'row', margin: 16, justifyContent: 'space-evenly' }}>
{/* {/*
So the idea here, due to Apple banning native Lapp marketplace, is: Current logic - Onchain:
On Android everythins works as it worked before. Single "Marketplace" button that leads to LappBrowser that - Shows buy button on middle when empty
opens /marketplace/ url of offchain wallet type, and /marketplace-btc/ for onchain is not, but on the details. - Show buy button on top when not empty
On iOS its more complicated - we have one button that opens same page _externally_ (in Safari), and second - Shows Marketplace button on details screen, open in browser (iOS)
button that opens actual LappBrowser but with _blank_ page. This is important to not trigger Apple. - Shows Marketplace button on details screen, open in in-app (android)
Blank page is also the way Trust Wallet does it with Dapp Browser. Current logic - Offchain:
For ONCHAIN wallet type no LappBrowser button should be displayed, its Lightning-network specific. - Shows Lapp Browser empty (iOS)
- Shows Lapp Browser with marketplace (android)
- Shows Marketplace button to open in browser (iOS)
The idea is to avoid showing on iOS an appstore/market style app that goes against the TOS.
*/} */}
{this.state.wallet.getTransactions().length > 0 && {this.state.wallet.getTransactions().length > 0 &&
this.state.wallet.type !== LightningCustodianWallet.type && this.state.wallet.type !== LightningCustodianWallet.type &&
@ -322,6 +327,11 @@ export default class WalletTransactions extends Component {
android: ( android: (
<TouchableOpacity <TouchableOpacity
onPress={() => { onPress={() => {
if (this.state.wallet.type === LightningCustodianWallet.type) {
this.props.navigation.navigate('LappBrowser', { fromSecret: this.state.wallet.getSecret(), fromWallet: this.state.wallet });
} else {
this.props.navigation.navigate('Marketplace', { fromWallet: this.state.wallet });
}
this.props.navigation.navigate('Marketplace', { fromWallet: this.state.wallet }); this.props.navigation.navigate('Marketplace', { fromWallet: this.state.wallet });
}} }}
style={{ style={{

Loading…
Cancel
Save