FIX: Wallet selection

This commit is contained in:
Marcos Rodriguez Vélez 2019-02-24 14:49:04 -05:00 committed by Igor Korsakov
parent 397c153a3b
commit ffd4b82832
3 changed files with 8 additions and 13 deletions

View File

@ -44,6 +44,7 @@ export default class ManageFunds extends Component {
memo: loc.lnd.refill_lnd_balance,
fromSecret: wallet.getSecret(),
address: toAddress,
fromWallet: wallet,
});
}, 100);
} else {

View File

@ -60,6 +60,7 @@ export default class SendDetails extends Component {
let fromSecret;
if (props.navigation.state.params) fromSecret = props.navigation.state.params.fromSecret;
let fromWallet = null;
if (props.navigation.state.params) fromWallet = props.navigation.state.params.fromWallet;
const wallets = BlueApp.getWallets().filter(wallet => wallet.type !== LightningCustodianWallet.type);
@ -72,18 +73,6 @@ export default class SendDetails extends Component {
fromAddress = fromWallet.getAddress();
fromSecret = fromWallet.getSecret();
}
if (fromWallet === null) return props.navigation.goBack(null);
for (let w of wallets) {
if (w.getSecret() === fromSecret) {
fromWallet = w;
break;
}
if (w.getAddress() === fromAddress) {
fromWallet = w;
}
}
this.state = {
isFeeSelectionModalVisible: false,
fromAddress,
@ -703,6 +692,7 @@ SendDetails.propTypes = {
fromAddress: PropTypes.string,
satoshiPerByte: PropTypes.string,
fromSecret: PropTypes.fromSecret,
fromWallet: PropTypes.fromWallet,
memo: PropTypes.string,
uri: PropTypes.string,
}),

View File

@ -486,7 +486,11 @@ export default class WalletTransactions extends Component {
if (this.state.wallet.type === LightningCustodianWallet.type) {
navigate('ScanLndInvoice', { fromSecret: this.state.wallet.getSecret() });
} else {
navigate('SendDetails', { fromAddress: this.state.wallet.getAddress(), fromSecret: this.state.wallet.getSecret() });
navigate('SendDetails', {
fromAddress: this.state.wallet.getAddress(),
fromSecret: this.state.wallet.getSecret(),
fromWallet: this.state.wallet,
});
}
}}
/>