FIX: Remove Lightning wallet creation limitation

This commit is contained in:
Marcos Rodriguez Vélez 2019-01-09 10:25:03 -05:00
parent 204e4ba867
commit aee5f407ee
3 changed files with 4 additions and 14 deletions

View file

@ -33,7 +33,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>227</string>
<string>228</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>

View file

@ -14,7 +14,8 @@ module.exports = {
wallets: {
select_wallet: 'Select Wallet',
options: 'options',
createBitcoinWallet: 'In order to use a Lightning wallet, a Bitcoin wallet is needed to fund it. Would you like to continue anyway?',
createBitcoinWallet:
'You currently do not have a Bitcoin wallet. In order to fund a Lightning wallet, a Bitcoin wallet needs to be created or imported. Would you like to continue anyway?',
list: {
app_name: 'Blue Wallet',
title: 'wallets',

View file

@ -1,4 +1,3 @@
/* global alert */
import React, { Component } from 'react';
import { Alert, AsyncStorage, ActivityIndicator, Keyboard, Dimensions, View, TextInput, TouchableWithoutFeedback } from 'react-native';
import {
@ -194,16 +193,6 @@ export default class WalletsAdd extends Component {
if (this.state.activeLightning) {
// eslint-disable-next-line
let hasBitcoinWallet = false;
for (let t of BlueApp.getWallets()) {
if (t.type === LightningCustodianWallet.type) {
// already exist
this.setState({ isLoading: false });
return alert('Only 1 Lightning wallet allowed for now');
} else if (t.type !== LightningCustodianWallet.type) {
hasBitcoinWallet = true;
}
}
this.createLightningWallet = async () => {
w = new LightningCustodianWallet();
@ -232,7 +221,7 @@ export default class WalletsAdd extends Component {
this.props.navigation.dismiss();
};
if (!hasBitcoinWallet) {
if (!BlueApp.getWallets().some(wallet => wallet.type !== LightningCustodianWallet.type)) {
Alert.alert(
loc.wallets.add.lightning,
loc.wallets.createBitcoinWallet,