diff --git a/ViewGraph.tsx b/ViewGraph.tsx index fe07e0d..93ffe90 100644 --- a/ViewGraph.tsx +++ b/ViewGraph.tsx @@ -21,7 +21,7 @@ export default function ViewGraph() { const { params } = useRoute>(); const [weights, setWeights] = useState(); const [volumes, setVolumes] = useState(); - const [metric, setMetric] = useState(Metrics.Weight); + const [metric, setMetric] = useState(Metrics.OneRepMax); const [period, setPeriod] = useState(Periods.Monthly); useEffect(() => { @@ -42,7 +42,7 @@ export default function ViewGraph() { .groupBy("name") .addGroupBy(`STRFTIME('${group}', created)`); switch (metric) { - case Metrics.Weight: + case Metrics.Best: builder .addSelect("ROUND(MAX(weight), 2)", "weight") .getRawMany() @@ -72,7 +72,7 @@ export default function ViewGraph() { const charts = useMemo(() => { if ( (metric === Metrics.Volume && volumes?.length === 0) || - (metric === Metrics.Weight && weights?.length === 0) || + (metric === Metrics.Best && weights?.length === 0) || (metric === Metrics.OneRepMax && weights?.length === 0) ) { return ; @@ -127,12 +127,9 @@ export default function ViewGraph() {