Skip to content

Commit

Permalink
FIX: Fixed alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosrdz committed Nov 9, 2019
1 parent e37e260 commit a4ae836
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
1 change: 0 additions & 1 deletion App.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { AppStorage, LightningCustodianWallet } from './class';
import { Chain } from './models/bitcoinUnits';
import QuickActions from 'react-native-quick-actions';
import * as Sentry from '@sentry/react-native';
import WalletGradient from './class/walletGradient';
import OnAppLaunch from './class/onAppLaunch';

if (process.env.NODE_ENV !== 'development') {
Expand Down
31 changes: 14 additions & 17 deletions screen/wallets/transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,31 +355,28 @@ export default class WalletTransactions extends Component {
};

onWalletSelect = async wallet => {
NavigationService.navigate('WalletTransactions', {
key: `WalletTransactions-${wallet.getID()}`,
});
/** @type {LightningCustodianWallet} */
let toAddress = false;
if (this.state.wallet.refill_addressess.length > 0) {
toAddress = this.state.wallet.refill_addressess[0];
} else {
try {
await this.state.wallet.fetchBtcAddress();
if (wallet) {
NavigationService.navigate('WalletTransactions', {
key: `WalletTransactions-${wallet.getID()}`,
});
/** @type {LightningCustodianWallet} */
let toAddress = false;
if (this.state.wallet.refill_addressess.length > 0) {
toAddress = this.state.wallet.refill_addressess[0];
} catch (Err) {
return alert(Err.message);
} else {
try {
await this.state.wallet.fetchBtcAddress();
toAddress = this.state.wallet.refill_addressess[0];
} catch (Err) {
return alert(Err.message);
}
}
}

if (wallet) {
this.props.navigation.navigate('SendDetails', {
memo: loc.lnd.refill_lnd_balance,
fromSecret: wallet.getSecret(),
address: toAddress,
fromWallet: wallet,
});
} else {
return alert('Internal error');
}
};

Expand Down

0 comments on commit a4ae836

Please sign in to comment.