sum up lbc amounts
This commit is contained in:
parent
2117072bad
commit
bed9856e48
1 changed files with 6 additions and 6 deletions
|
@ -44,27 +44,27 @@ export default function LivestreamComments(props: Props) {
|
||||||
doCommentList,
|
doCommentList,
|
||||||
fetchingComments,
|
fetchingComments,
|
||||||
doSuperChatList,
|
doSuperChatList,
|
||||||
superChatsTotalAmount,
|
|
||||||
myChannels,
|
myChannels,
|
||||||
superChats, // superchats organized by tip amount
|
superChats, // superchats organized by tip amount
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
let { superChatsReversed, superChatsFiatAmount } = props;
|
let { superChatsReversed, superChatsFiatAmount, superChatsTotalAmount } = props;
|
||||||
|
|
||||||
superChatsFiatAmount = 0;
|
|
||||||
|
|
||||||
|
// sum total amounts for fiat tips and lbc tips
|
||||||
if(superChats){
|
if(superChats){
|
||||||
console.log(superChats);
|
|
||||||
|
|
||||||
let fiatAmount = 0;
|
let fiatAmount = 0;
|
||||||
|
let LBCAmount = 0;
|
||||||
for(const superChat of superChats){
|
for(const superChat of superChats){
|
||||||
if(superChat.is_fiat){
|
if(superChat.is_fiat){
|
||||||
fiatAmount = fiatAmount + superChat.support_amount;
|
fiatAmount = fiatAmount + superChat.support_amount;
|
||||||
|
} else {
|
||||||
|
LBCAmount = LBCAmount + superChat.support_amount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
superChatsFiatAmount = fiatAmount;
|
superChatsFiatAmount = fiatAmount;
|
||||||
|
superChatsTotalAmount = LBCAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: why doesn't this work?
|
// TODO: why doesn't this work?
|
||||||
|
|
Loading…
Reference in a new issue