From 5cbfe5045595af8637a2845f493949e98fb885a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Thu, 18 Jul 2024 19:05:18 -0500 Subject: [PATCH] feat: removed all averages requirements --- .../tools/tank-performance/components/Info.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/app/tools/tank-performance/components/Info.tsx b/src/app/tools/tank-performance/components/Info.tsx index c3a033a73..269123ab1 100644 --- a/src/app/tools/tank-performance/components/Info.tsx +++ b/src/app/tools/tank-performance/components/Info.tsx @@ -10,7 +10,11 @@ import { useAveragesExclusionRatio } from '../../../../hooks/useAveragesExclusio export function Info() { const awaitedAverageDefinitions = use(averageDefinitions); const ratio = useAveragesExclusionRatio(); - const samples = ratio * awaitedAverageDefinitions.samples.d_120; + const samples = ratio * awaitedAverageDefinitions.samples.total; + const minutesAgo = Math.floor( + (Date.now() - awaitedAverageDefinitions.time) / (1000 * 60), + ); + const hoursAgo = Math.floor(minutesAgo / 60); return ( @@ -19,13 +23,9 @@ export function Info() { - Career stats based on {formatCompact(Math.round(samples))} players - with at least 5K career battles and 1 battle in the past 120 days. - Updated{' '} - {Math.floor( - (Date.now() - awaitedAverageDefinitions.time) / (1000 * 60 * 60), - )}{' '} - hours ago. + Career stats based on {formatCompact(Math.round(samples))} players. + Updated {hoursAgo === 0 ? minutesAgo : hoursAgo}{' '} + {hoursAgo === 0 ? 'minutes' : 'hours'} ago.