More stripe integration #6649

Closed
mayeaux wants to merge 17 commits from more-stripe-integration into master
Showing only changes of commit b2e990c9dd - Show all commits

View file

@ -131,6 +131,7 @@ export function CommentCreate(props: Props) {
return; return;
} }
// if comment post didn't work, but tip was already made, try againt o create comment
if (commentFailure && tipAmount === successTip.tipAmount) { if (commentFailure && tipAmount === successTip.tipAmount) {
handleCreateComment(successTip.txid); handleCreateComment(successTip.txid);
return; return;
@ -147,6 +148,21 @@ export function CommentCreate(props: Props) {
const activeChannelName = activeChannelClaim && activeChannelClaim.name; const activeChannelName = activeChannelClaim && activeChannelClaim.name;
const activeChannelId = activeChannelClaim && activeChannelClaim.claim_id; const activeChannelId = activeChannelClaim && activeChannelClaim.claim_id;
// setup variables for tip API
let channelClaimId, tipChannelName;
// if there is a signing channel it's on a file
if (claim.signing_channel) {
channelClaimId = claim.signing_channel.claim_id;
tipChannelName = claim.signing_channel.name;
// otherwise it's on the channel page
} else {
channelClaimId = claim.claim_id;
tipChannelName = claim.name;
}
console.log(activeChannelClaim);
setIsSubmitting(true); setIsSubmitting(true);
if (activeTab === TAB_LBC) { if (activeTab === TAB_LBC) {
@ -160,6 +176,14 @@ export function CommentCreate(props: Props) {
setTimeout(() => { setTimeout(() => {
handleCreateComment(txid); handleCreateComment(txid);
}, 1500); }, 1500);
doToast({
message: __("You sent %tipAmount% LBRY Credits as a tip to %tipChannelName%, I'm sure they appreciate it!", {
tipAmount: tipAmount, // force show decimal places
tipChannelName
}),
});
setSuccessTip({ txid, tipAmount }); setSuccessTip({ txid, tipAmount });
}, },
() => { () => {
@ -168,18 +192,6 @@ export function CommentCreate(props: Props) {
} }
); );
} else { } else {
// setup variables for tip API
let channelClaimId, tipChannelName;
// if there is a signing channel it's on a file
if (claim.signing_channel) {
channelClaimId = claim.signing_channel.claim_id;
tipChannelName = claim.signing_channel.name;
// otherwise it's on the channel page
} else {
channelClaimId = claim.claim_id;
tipChannelName = claim.name;
}
const sourceClaimId = claim.claim_id; const sourceClaimId = claim.claim_id;
const roundedAmount = Math.round(tipAmount * 100) / 100; const roundedAmount = Math.round(tipAmount * 100) / 100;