Merge pull request #1391 from lbryio/send-fix

fix: send correct values to sendTx
This commit is contained in:
Sean Yesmunt 2018-04-25 17:50:19 -04:00 committed by GitHub
commit 6dd2cd2562
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View file

@ -3,7 +3,7 @@ import { doSendDraftTransaction, selectBalance } from 'lbry-redux';
import WalletSend from './view'; import WalletSend from './view';
const perform = dispatch => ({ const perform = dispatch => ({
sendToAddress: values => dispatch(doSendDraftTransaction(values)), sendToAddress: (address, amount) => dispatch(doSendDraftTransaction(address, amount)),
}); });
const select = state => ({ const select = state => ({

View file

@ -7,11 +7,11 @@ import { validateSendTx } from 'util/form-validation';
type DraftTransaction = { type DraftTransaction = {
address: string, address: string,
amount: number | string, // So we can use a placeholder in the input amount: ?number, // So we can use a placeholder in the input
}; };
type Props = { type Props = {
sendToAddress: DraftTransaction => void, sendToAddress: (string, number) => void,
balance: number, balance: number,
}; };
@ -24,7 +24,10 @@ class WalletSend extends React.PureComponent<Props> {
handleSubmit(values: DraftTransaction) { handleSubmit(values: DraftTransaction) {
const { sendToAddress } = this.props; const { sendToAddress } = this.props;
sendToAddress(values); const { address, amount } = values;
if (amount && address) {
sendToAddress(address, amount);
}
} }
render() { render() {