diff --git a/ui/component/commentCreate/view.jsx b/ui/component/commentCreate/view.jsx index bdf515e4e..8e113f269 100644 --- a/ui/component/commentCreate/view.jsx +++ b/ui/component/commentCreate/view.jsx @@ -72,8 +72,7 @@ export function CommentCreate(props: Props) { sendTip, doToast, } = props; - const buttonref: ElementRef = React.useRef(); - + const buttonRef: ElementRef = React.useRef(); const { push, location: { pathname }, @@ -89,11 +88,8 @@ export function CommentCreate(props: Props) { const [advancedEditor, setAdvancedEditor] = usePersistedState('comment-editor-mode', false); const hasChannels = channels && channels.length; const charCount = commentValue.length; - const [activeTab, setActiveTab] = React.useState(''); - const [tipError, setTipError] = React.useState(); - const disabled = isSubmitting || !activeChannelClaim || !commentValue.length; const [shouldDisableReviewButton, setShouldDisableReviewButton] = React.useState(); @@ -112,7 +108,7 @@ export function CommentCreate(props: Props) { const KEYCODE_ENTER = 13; if ((livestream || e.ctrlKey || e.metaKey) && e.keyCode === KEYCODE_ENTER) { e.preventDefault(); - buttonref.current.click(); + buttonRef.current.click(); } } @@ -186,8 +182,7 @@ export function CommentCreate(props: Props) { } const sourceClaimId = claim.claim_id; - - var roundedAmount = Math.round(tipAmount * 100) / 100; + const roundedAmount = Math.round(tipAmount * 100) / 100; Lbryio.call( 'customer', @@ -206,8 +201,6 @@ export function CommentCreate(props: Props) { 'post' ) .then((customerTipResponse) => { - console.log(customerTipResponse); - const paymentIntendId = customerTipResponse.payment_intent_id; handleCreateComment(null, paymentIntendId, stripeEnvironment); @@ -227,14 +220,14 @@ export function CommentCreate(props: Props) { // handleCreateComment(null); }) - .catch(function (error) { - var displayError = 'Sorry, there was an error in processing your payment!'; - - if (error.message !== 'payment intent failed to confirm') { - displayError = error.message; - } - - doToast({ message: displayError, isError: true }); + .catch((error) => { + doToast({ + message: + error.message !== 'payment intent failed to confirm' + ? error.message + : 'Sorry, there was an error in processing your payment!', + isError: true, + }); }); } } @@ -263,7 +256,7 @@ export function CommentCreate(props: Props) { } } }) - .catch((e) => { + .catch(() => { setIsSubmitting(false); setCommentFailure(true); }); @@ -313,7 +306,7 @@ export function CommentCreate(props: Props) {