From 43f40fcabb19ab64c0bb23cd1d682b6824f875aa Mon Sep 17 00:00:00 2001 From: Anthony Date: Sun, 25 Jul 2021 20:03:54 +0200 Subject: [PATCH] sum up lbc amounts --- ui/component/livestreamComments/view.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/component/livestreamComments/view.jsx b/ui/component/livestreamComments/view.jsx index 6944cdfee..8d1574ee4 100644 --- a/ui/component/livestreamComments/view.jsx +++ b/ui/component/livestreamComments/view.jsx @@ -44,27 +44,27 @@ export default function LivestreamComments(props: Props) { doCommentList, fetchingComments, doSuperChatList, - superChatsTotalAmount, myChannels, superChats, // superchats organized by tip amount } = props; - let { superChatsReversed, superChatsFiatAmount } = props; - - superChatsFiatAmount = 0; + let { superChatsReversed, superChatsFiatAmount, superChatsTotalAmount } = props; + // sum total amounts for fiat tips and lbc tips if(superChats){ - console.log(superChats); let fiatAmount = 0; + let LBCAmount = 0; for(const superChat of superChats){ if(superChat.is_fiat){ fiatAmount = fiatAmount + superChat.support_amount; + } else { + LBCAmount = LBCAmount + superChat.support_amount; } } superChatsFiatAmount = fiatAmount; - + superChatsTotalAmount = LBCAmount; } // TODO: why doesn't this work?