mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-29 00:11:28 +00:00
flow...
This commit is contained in:
parent
d34ef851d0
commit
4f6740d1f8
1 changed files with 43 additions and 41 deletions
|
@ -75,6 +75,8 @@ function WalletSendTip(props: Props) {
|
||||||
const [isConfirming, setIsConfirming] = React.useState(false);
|
const [isConfirming, setIsConfirming] = React.useState(false);
|
||||||
const { claim_id: claimId } = claim;
|
const { claim_id: claimId } = claim;
|
||||||
const { channelName } = parseURI(uri);
|
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 [canReceiveFiatTip, setCanReceiveFiatTip] = React.useState(); // dont persist because it needs to be calc'd per creator
|
||||||
const [hasCardSaved, setHasSavedCard] = usePersistedState('comment-support:hasCardSaved', false);
|
const [hasCardSaved, setHasSavedCard] = usePersistedState('comment-support:hasCardSaved', false);
|
||||||
|
@ -234,8 +236,8 @@ function WalletSendTip(props: Props) {
|
||||||
amount: 100 * tipAmount, // convert from dollars to cents
|
amount: 100 * tipAmount, // convert from dollars to cents
|
||||||
creator_channel_name: tipChannelName, // creator_channel_name
|
creator_channel_name: tipChannelName, // creator_channel_name
|
||||||
creator_channel_claim_id: channelClaimId,
|
creator_channel_claim_id: channelClaimId,
|
||||||
tipper_channel_name: sendAnonymously ? '' : activeChannelClaim.name,
|
tipper_channel_name: sendAnonymously ? '' : activeChannelName,
|
||||||
tipper_channel_claim_id: sendAnonymously ? '' : activeChannelClaim.claim_id,
|
tipper_channel_claim_id: sendAnonymously ? '' : activeChannelId,
|
||||||
currency: 'USD',
|
currency: 'USD',
|
||||||
anonymous: sendAnonymously,
|
anonymous: sendAnonymously,
|
||||||
source_claim_id: sourceClaimId,
|
source_claim_id: sourceClaimId,
|
||||||
|
@ -276,7 +278,8 @@ function WalletSendTip(props: Props) {
|
||||||
function isNan(tipAmount) {
|
function isNan(tipAmount) {
|
||||||
// testing for NaN ES5 style https://stackoverflow.com/a/35912757/3973137
|
// testing for NaN ES5 style https://stackoverflow.com/a/35912757/3973137
|
||||||
// also sometimes it's returned as a string
|
// 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 true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -296,8 +299,7 @@ function WalletSendTip(props: Props) {
|
||||||
|
|
||||||
function shouldDisableAmountSelector(amount) {
|
function shouldDisableAmountSelector(amount) {
|
||||||
return (
|
return (
|
||||||
(amount > balance && activeTab !== TAB_FIAT) ||
|
(amount > balance && activeTab !== TAB_FIAT) || (activeTab === TAB_FIAT && (!hasCardSaved || !canReceiveFiatTip))
|
||||||
(activeTab === TAB_FIAT && (!hasCardSaved || !canReceiveFiatTip))
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue