Skip to content

Commit e1eb9e7

Browse files
committed
Fix alg duration
1 parent 911cc23 commit e1eb9e7

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/timer/AlgTable.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export function AlgTable({ solve }: { solve: Solve }) {
2929

3030
let time = solve.solution[0]?.cubeTimestamp ?? 0;
3131

32+
console.log(solve);
3233
return (
3334
<ScrollArea className="h-64 w-full rounded-md border p-2">
3435
<Table>
@@ -42,9 +43,10 @@ export function AlgTable({ solve }: { solve: Solve }) {
4243
<TableBody>
4344
{solve.algs.map(alg => {
4445
const moveIdx = alg[2];
46+
console.log(time, solve.solution[moveIdx]?.cubeTimestamp, solve.solution[moveIdx]?.cubeTimestamp ?? 0 - time);
4547
const algTime =
46-
(solve.solution[moveIdx]?.cubeTimestamp ?? 0 - time) / 1000;
47-
time = solve.solution[moveIdx]?.cubeTimestamp ?? 0;
48+
((solve.solution[moveIdx]?.cubeTimestamp ?? 0) - time) / 1000;
49+
time = (solve.solution[moveIdx]?.cubeTimestamp ?? 0);
4850

4951
return (
5052
<Tooltip key={alg[2] + algTime}>

0 commit comments

Comments
 (0)