handle doSendSupport error like complete #23

Merged
daovist merged 1 commit from send-support-error into master 2018-05-15 06:16:58 +02:00

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);
};
}