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;
}
// 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) {
handleCreateComment(successTip.txid);
return;
@ -161,8 +161,6 @@ export function CommentCreate(props: Props) {
tipChannelName = claim.name;
}
console.log(activeChannelClaim);
setIsSubmitting(true);
if (activeTab === TAB_LBC) {

View file

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

View file

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