bugfix and cleanup

This commit is contained in:
Anthony 2021-08-10 21:55:38 +02:00
parent 8f419fea67
commit 5e37b3ebba
No known key found for this signature in database
GPG key ID: C386D3C93D50E356
3 changed files with 7 additions and 8 deletions

View file

@ -131,7 +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 comment post didn't work, but tip was already made, try again to create comment
if (commentFailure && tipAmount === successTip.tipAmount) { if (commentFailure && tipAmount === successTip.tipAmount) {
handleCreateComment(successTip.txid); handleCreateComment(successTip.txid);
return; return;
@ -161,8 +161,6 @@ export function CommentCreate(props: Props) {
tipChannelName = claim.name; tipChannelName = claim.name;
} }
console.log(activeChannelClaim);
setIsSubmitting(true); setIsSubmitting(true);
if (activeTab === TAB_LBC) { if (activeTab === TAB_LBC) {

View file

@ -22,8 +22,6 @@ type Props = {
fetchingComments: boolean, fetchingComments: boolean,
doSuperChatList: (string) => void, doSuperChatList: (string) => void,
superChats: Array<Comment>, superChats: Array<Comment>,
superChatsTotalAmount: number,
superChatsFiatAmount: number,
myChannels: ?Array<ChannelClaim>, myChannels: ?Array<ChannelClaim>,
}; };
@ -39,7 +37,7 @@ export default function LivestreamComments(props: Props) {
embed, embed,
doCommentSocketConnect, doCommentSocketConnect,
doCommentSocketDisconnect, doCommentSocketDisconnect,
comments, // superchats in chronological format comments, // comments in chronological order (oldest first)
doCommentList, doCommentList,
fetchingComments, fetchingComments,
doSuperChatList, doSuperChatList,
@ -47,7 +45,7 @@ export default function LivestreamComments(props: Props) {
superChats, // superchats organized by tip amount superChats, // superchats organized by tip amount
} = props; } = props;
let { superChatsFiatAmount, superChatsTotalAmount } = props; let superChatsFiatAmount, superChatsTotalAmount;
const commentsRef = React.createRef(); const commentsRef = React.createRef();
const [scrollBottom, setScrollBottom] = React.useState(true); const [scrollBottom, setScrollBottom] = React.useState(true);

View file

@ -141,6 +141,8 @@ function WalletSendTip(props: Props) {
.then((accountCheckResponse) => { .then((accountCheckResponse) => {
if (accountCheckResponse === true && canReceiveFiatTip !== true) { if (accountCheckResponse === true && canReceiveFiatTip !== true) {
setCanReceiveFiatTip(true); setCanReceiveFiatTip(true);
} else {
setCanReceiveFiatTip(false);
} }
}) })
.catch(function (error) { .catch(function (error) {
@ -332,6 +334,7 @@ function WalletSendTip(props: Props) {
setCustomTipAmount(''); setCustomTipAmount('');
} }
// allow maximum of two decimal places
if (howManyDecimals > 2) { if (howManyDecimals > 2) {
tipAmount = Math.floor(tipAmount * 100) / 100; tipAmount = Math.floor(tipAmount * 100) / 100;
} }
@ -340,6 +343,7 @@ function WalletSendTip(props: Props) {
if (howManyDigits > 4 && tipAmount !== 1000) { if (howManyDigits > 4 && tipAmount !== 1000) {
setTipError('Amount cannot be over 1000 dollars'); setTipError('Amount cannot be over 1000 dollars');
setCustomTipAmount(tipAmount);
} else if (tipAmount > 1000) { } else if (tipAmount > 1000) {
setTipError('Amount cannot be over 1000 dollars'); setTipError('Amount cannot be over 1000 dollars');
setCustomTipAmount(tipAmount); setCustomTipAmount(tipAmount);
@ -576,7 +580,6 @@ function WalletSendTip(props: Props) {
)} )}
</React.Fragment> </React.Fragment>
} }
className="form-field--price-amount"
error={tipError} error={tipError}
min="0" min="0"
step="any" step="any"