Merge pull request #23 from lbryio/send-support-error

handle doSendSupport error like complete
This commit is contained in:
Sean Yesmunt 2018-05-15 00:16:57 -04:00 committed by GitHub
commit 4b53175ecd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -212,6 +212,26 @@ export function doSendSupport(amount, claimId, uri, successCallback, errorCallba
}
};
const error = err => {
dispatch(
doNotify({
message: __(`There was an error sending support funds.`),
displayType: ['snackbar'],
})
);
dispatch({
type: ACTIONS.SUPPORT_TRANSACTION_FAILED,
data: {
error: err,
},
});
if (errorCallback) {
errorCallback();
}
};
dispatch({
type: ACTIONS.SUPPORT_TRANSACTION_STARTED,
});
@ -219,6 +239,6 @@ export function doSendSupport(amount, claimId, uri, successCallback, errorCallba
Lbry.wallet_send({
claim_id: claimId,
amount,
}).then(success, errorCallback);
}).then(success, error);
};
}