Skip to content

Commit 2f89725

Browse files
committed
fix: few code smells
1 parent 4b0811f commit 2f89725

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

web/src/pages/Courts/CourtDetails/StakePanel/Simulator/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ const Simulator: React.FC<ISimulator> = ({ amountToStake, isStaking }) => {
233233
<QuantityToSimulate {...{ jurorCurrentEffectiveStake, jurorCurrentSpecificStake, isStaking, amountToStake }} />
234234
<ItemsContainer>
235235
{simulatorItems.map((item, index) => (
236-
<SimulatorItem key={index}>
236+
<SimulatorItem key={item.title}>
237237
<LeftContent>
238238
<IconWrapper>{item.icon}</IconWrapper>
239239
{item.tooltipMsg ? (

web/src/utils/beautifyStatNumber.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export function unbeautifyStatNumber(value: string): number {
2828
K: 1e3,
2929
};
3030

31-
const match = value.match(/^([\d,\.]+)([BMK]?)$/);
31+
const regex = /^([\d,.]+)([BMK]?)$/;
32+
const match = regex.exec(value);
3233

3334
if (!match) {
3435
throw new Error("Invalid formatted number string");

0 commit comments

Comments
 (0)