fix: stats wn8 fallback

This commit is contained in:
TrèsAbhi committed 2024-06-06 19:41:53 -05:00
1 parent 83bcca7f69
commit 8ef0bfd7eb
1 file changed
+7 -6
+7 -6
View File
@@ -32,14 +32,15 @@ export default function AllStatsOverview({
}: AllStatsOverviewProps) { }: AllStatsOverviewProps) {
const { t, translate } = translator(locale); const { t, translate } = translator(locale);
const percentile = const percentile =
supplementaryStats.WN8 === undefined typeof supplementaryStats.WN8 === 'number'
? Percentile.VeryBad ? getWN8Percentile(supplementaryStats.WN8)
: getWN8Percentile(supplementaryStats.WN8); : Percentile.VeryBad;
const color = PERCENTILE_COLORS[percentile]; const color = PERCENTILE_COLORS[percentile];
const heroStat = const heroStat =
supplementaryStats.WN8 === undefined typeof supplementaryStats.WN8 === 'number'
? '--' ? supplementaryStats.WN8.toFixed(0)
: supplementaryStats.WN8.toFixed(0); : '--';
return ( return (
<div <div