Fix showing best records

This commit is contained in:
Brandon Presley 2022-09-04 16:35:40 +12:00
parent e483187338
commit 76e0ea49b4
1 changed files with 5 additions and 2 deletions

View File

@ -17,9 +17,12 @@ export default function BestList() {
const refresh = useCallback(async () => {
const weights = await getBestWeights(search);
console.log(BestList.name, {weights});
let newBest: Set[] = [];
for (const set of weights)
newBest.push(...(await getBestReps(search, set.weight)));
for (const set of weights) {
const reps = await getBestReps(set.name, set.weight);
newBest.push(...reps);
}
setBests(newBest);
}, [search]);