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';
|
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 => ({
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue