fix: send correct values to sendTx
This commit is contained in:
parent
eb06c9261d
commit
ab6756b7ab
2 changed files with 7 additions and 4 deletions
|
@ -3,7 +3,7 @@ import { doSendDraftTransaction, selectBalance } from 'lbry-redux';
|
|||
import WalletSend from './view';
|
||||
|
||||
const perform = dispatch => ({
|
||||
sendToAddress: values => dispatch(doSendDraftTransaction(values)),
|
||||
sendToAddress: (address, amount) => dispatch(doSendDraftTransaction(address, amount)),
|
||||
});
|
||||
|
||||
const select = state => ({
|
||||
|
|
|
@ -7,11 +7,11 @@ import { validateSendTx } from 'util/form-validation';
|
|||
|
||||
type DraftTransaction = {
|
||||
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 = {
|
||||
sendToAddress: DraftTransaction => void,
|
||||
sendToAddress: (string, number) => void,
|
||||
balance: number,
|
||||
};
|
||||
|
||||
|
@ -24,7 +24,10 @@ class WalletSend extends React.PureComponent<Props> {
|
|||
|
||||
handleSubmit(values: DraftTransaction) {
|
||||
const { sendToAddress } = this.props;
|
||||
sendToAddress(values);
|
||||
const { address, amount } = values;
|
||||
if (amount && address) {
|
||||
sendToAddress(address, amount);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
Loading…
Reference in a new issue