From e5512b016f57142177c34c7142c8b61b9555c28c Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Fri, 13 Aug 2021 09:37:32 +0800 Subject: [PATCH] Lint, autoformat -- no functional change. Doing this now so that an upcoming PR that uses this file won't include these bunch of annoying auto-formatter changes in the diff. --- ui/component/livestreamComments/view.jsx | 78 +++++++++++++----------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/ui/component/livestreamComments/view.jsx b/ui/component/livestreamComments/view.jsx index 4341acc87..4fc1e6645 100644 --- a/ui/component/livestreamComments/view.jsx +++ b/ui/component/livestreamComments/view.jsx @@ -133,15 +133,17 @@ export default function LivestreamComments(props: Props) { const clonedSuperchats = JSON.parse(JSON.stringify(superChatsByTipAmount)); // sort by fiat first then by support amount - superChatsReversed = clonedSuperchats.sort(function(a, b) { - // if both are fiat, organize by support - if (a.is_fiat === b.is_fiat) { - return b.support_amount - a.support_amount; - // otherwise, if they are not both fiat, put the fiat transaction first - } else { - return (a.is_fiat === b.is_fiat) ? 0 : a.is_fiat ? -1 : 1; - } - }).reverse(); + superChatsReversed = clonedSuperchats + .sort((a, b) => { + // if both are fiat, organize by support + if (a.is_fiat === b.is_fiat) { + return b.support_amount - a.support_amount; + // otherwise, if they are not both fiat, put the fiat transaction first + } else { + return a.is_fiat === b.is_fiat ? 0 : a.is_fiat ? -1 : 1; + } + }) + .reverse(); } // todo: implement comment_list --mine in SDK so redux can grab with selectCommentIsMine @@ -173,14 +175,13 @@ export default function LivestreamComments(props: Props) {
{__('Live discussion')}
{(superChatsTotalAmount || 0) > 0 && (
- {/* the superchats in chronological order button */}