handle doSendSupport error like complete
This commit is contained in:
parent
86530690e9
commit
c5f8cc1bdf
1 changed files with 21 additions and 1 deletions
|
@ -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);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue