don't include ties, again..

This commit is contained in:
2025-05-21 22:11:53 +02:00
parent 0f1386f3bf
commit f698fd9035

View File

@@ -29,9 +29,9 @@ export function WinrateTrendChart({ games }: { games: SelectGames[] }) {
const [gamesWindow, setGamesWindow] = useState(30) const [gamesWindow, setGamesWindow] = useState(30)
// Sort games by date (oldest to newest) // Sort games by date (oldest to newest)
const sortedGames = [...games].sort( const sortedGames = [...games]
(a, b) => a.gameTime.getTime() - b.gameTime.getTime() .sort((a, b) => a.gameTime.getTime() - b.gameTime.getTime())
) .filter((game) => game.result === 'win' || game.result === 'loss')
// Calculate rolling winrate // Calculate rolling winrate
const chartData = calculateRollingWinrate(sortedGames, gamesWindow) const chartData = calculateRollingWinrate(sortedGames, gamesWindow)