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) {