This commit is contained in:
zeppi 2021-07-05 07:35:17 -04:00 committed by jessopb
parent d34ef851d0
commit 4f6740d1f8

View file

@ -75,6 +75,8 @@ function WalletSendTip(props: Props) {
const [isConfirming, setIsConfirming] = React.useState(false);
const { claim_id: claimId } = claim;
const { channelName } = parseURI(uri);
const activeChannelName = activeChannelClaim && activeChannelClaim.name;
const activeChannelId = activeChannelClaim && activeChannelClaim.claim_id;
const [canReceiveFiatTip, setCanReceiveFiatTip] = React.useState(); // dont persist because it needs to be calc'd per creator
const [hasCardSaved, setHasSavedCard] = usePersistedState('comment-support:hasCardSaved', false);
@ -234,8 +236,8 @@ function WalletSendTip(props: Props) {
amount: 100 * tipAmount, // convert from dollars to cents
creator_channel_name: tipChannelName, // creator_channel_name
creator_channel_claim_id: channelClaimId,
tipper_channel_name: sendAnonymously ? '' : activeChannelClaim.name,
tipper_channel_claim_id: sendAnonymously ? '' : activeChannelClaim.claim_id,
tipper_channel_name: sendAnonymously ? '' : activeChannelName,
tipper_channel_claim_id: sendAnonymously ? '' : activeChannelId,
currency: 'USD',
anonymous: sendAnonymously,
source_claim_id: sourceClaimId,
@ -276,7 +278,8 @@ function WalletSendTip(props: Props) {
function isNan(tipAmount) {
// testing for NaN ES5 style https://stackoverflow.com/a/35912757/3973137
// also sometimes it's returned as a string
if (tipAmount !== tipAmount || tipAmount === 'NaN') { //eslint-disable-line
// eslint-disable-next-line
if (tipAmount !== tipAmount || tipAmount === 'NaN') {
return true;
}
return false;
@ -296,8 +299,7 @@ function WalletSendTip(props: Props) {
function shouldDisableAmountSelector(amount) {
return (
(amount > balance && activeTab !== TAB_FIAT) ||
(activeTab === TAB_FIAT && (!hasCardSaved || !canReceiveFiatTip))
(amount > balance && activeTab !== TAB_FIAT) || (activeTab === TAB_FIAT && (!hasCardSaved || !canReceiveFiatTip))
);
}