Skip to content

Commit

Permalink
fix: show wrong statistics when input new board length
Browse files Browse the repository at this point in the history
  • Loading branch information
S-N-O-R-L-A-X committed Dec 23, 2023
1 parent c07a76a commit 7f2ab71
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/views/Analysis/Analysis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,18 @@ export default function Analysis() {
async function countTricks() {
for (const board of all_boards) {
if (!board.ddtricks) {
board.ddtricks = await analyzeOffline(board.board)
board.ddtricks = await analyzeOffline(board.board);
}
MatrixAdd(table, board.ddtricks as (string | number)[][]);
}

setTable(MatrixDivide(table,all_boards.length||1));
return Promise.resolve();
}
countTricks();

}, [all_boards])
countTricks().then(()=>{
if (all_boards.length > 0) {
setTable(MatrixDivide(table, all_boards.length));
}
})
}, [all_boards.length])

return (
<>
Expand Down

0 comments on commit 7f2ab71

Please sign in to comment.