From 40d32a6065c96113fb5b8597bea42b370fcc398f Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 17 Sep 2020 10:48:25 -0400 Subject: [PATCH] fix LbcMessage for single digit integers --- ui/component/common/lbc-message.jsx | 13 ++++++++----- ui/component/rewardLink/view.jsx | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ui/component/common/lbc-message.jsx b/ui/component/common/lbc-message.jsx index ff1d684a5..e8d5a6063 100644 --- a/ui/component/common/lbc-message.jsx +++ b/ui/component/common/lbc-message.jsx @@ -9,15 +9,18 @@ type Props = { export default function LbcMessage(props: Props) { let amount; - const tokenizedMessage = props.children.replace(/(\d?\.?-?\d+?\.?-?\d+?)\s(LBC)/g, (originalString, lbcAmount) => { - amount = lbcAmount; - return `%lbc%`; - }); + const tokenizedMessage = props.children.replace( + /(\d?\.?-?\d?\.?-?\d+?)\s(LBC)/g, + (originalString, lbcAmount, thirdArg) => { + amount = lbcAmount; + return `%lbc%`; + } + ); return ( : undefined }}> {/* Catch any rogue LBC's left */} - {tokenizedMessage.replace(/LBC/g, 'LBRY Credits')} + {tokenizedMessage.replace(/LBC/g, 'Credits')} ); } diff --git a/ui/component/rewardLink/view.jsx b/ui/component/rewardLink/view.jsx index 7e30f651c..79491b0a9 100644 --- a/ui/component/rewardLink/view.jsx +++ b/ui/component/rewardLink/view.jsx @@ -35,7 +35,7 @@ const RewardLink = (props: Props) => {