FIX: Hide loading indicator after push

This commit is contained in:
Marcos Rodriguez 2019-12-11 22:17:09 -05:00 committed by Overtorment
parent 5b1515ee3f
commit 748ec94bb4

View file

@ -495,22 +495,20 @@ export default class SendDetails extends Component {
this.setState({ isLoading: false }); this.setState({ isLoading: false });
return; return;
} }
this.props.navigation.navigate('Confirm', {
this.setState({ isLoading: false }, () => recipients: [firstTransaction],
this.props.navigation.navigate('Confirm', { // HD wallet's utxo is in sats, classic segwit wallet utxos are in btc
recipients: [firstTransaction], fee: this.calculateFee(
// HD wallet's utxo is in sats, classic segwit wallet utxos are in btc utxo,
fee: this.calculateFee( tx,
utxo, this.state.fromWallet.type === HDSegwitP2SHWallet.type || this.state.fromWallet.type === HDLegacyP2PKHWallet.type,
tx, ),
this.state.fromWallet.type === HDSegwitP2SHWallet.type || this.state.fromWallet.type === HDLegacyP2PKHWallet.type, memo: this.state.memo,
), fromWallet: this.state.fromWallet,
memo: this.state.memo, tx: tx,
fromWallet: this.state.fromWallet, satoshiPerByte: actualSatoshiPerByte.toFixed(2),
tx: tx, });
satoshiPerByte: actualSatoshiPerByte.toFixed(2), this.setState({ isLoading: false });
}),
);
}); });
} }
@ -543,14 +541,12 @@ export default class SendDetails extends Component {
// watch-only wallets with enabled HW wallet support have different flow. we have to show PSBT to user as QR code // watch-only wallets with enabled HW wallet support have different flow. we have to show PSBT to user as QR code
// so he can scan it and sign it. then we have to scan it back from user (via camera and QR code), and ask // so he can scan it and sign it. then we have to scan it back from user (via camera and QR code), and ask
// user whether he wants to broadcast it // user whether he wants to broadcast it
this.props.navigation.navigate('PsbtWithHardwareWallet', {
this.setState({ isLoading: false }, () => memo: this.state.memo,
this.props.navigation.navigate('PsbtWithHardwareWallet', { fromWallet: wallet,
memo: this.state.memo, psbt,
fromWallet: wallet, });
psbt, this.setState({ isLoading: false });
}),
);
return; return;
} }
@ -560,16 +556,15 @@ export default class SendDetails extends Component {
memo: this.state.memo, memo: this.state.memo,
}; };
await BlueApp.saveToDisk(); await BlueApp.saveToDisk();
this.setState({ isLoading: false }, () => this.props.navigation.navigate('Confirm', {
this.props.navigation.navigate('Confirm', { fee: new BigNumber(fee).dividedBy(100000000).toNumber(),
fee: new BigNumber(fee).dividedBy(100000000).toNumber(), memo: this.state.memo,
memo: this.state.memo, fromWallet: wallet,
fromWallet: wallet, tx: tx.toHex(),
tx: tx.toHex(), recipients: targets,
recipients: targets, satoshiPerByte: requestedSatPerByte,
satoshiPerByte: requestedSatPerByte, });
}), this.setState({ isLoading: false });
);
} }
onWalletSelect = wallet => { onWalletSelect = wallet => {