mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
fix: /today now preserves all WN8 values
This commit is contained in:
1 parent
ca208e44a1
commit
bd612bf777
1 file changed
+5
-4
@@ -56,22 +56,23 @@ export default async function today({ server, id }: ResolvedPlayer) {
|
|||||||
const todayWN8s = await tankStatsOverTimeEntries.reduce<
|
const todayWN8s = await tankStatsOverTimeEntries.reduce<
|
||||||
PossiblyPromise<Record<number, number>>
|
PossiblyPromise<Record<number, number>>
|
||||||
>(async (accumulator, [tankIdString, tankStats]) => {
|
>(async (accumulator, [tankIdString, tankStats]) => {
|
||||||
const tankId = Number(tankIdString);
|
const tankId = parseInt(tankIdString);
|
||||||
|
|
||||||
return tankId === 0 || (await tankAverages)[tankId] === undefined
|
return tankId === 0 || !(await tankAverages)[tankId]
|
||||||
? accumulator
|
? accumulator
|
||||||
: {
|
: {
|
||||||
...accumulator,
|
...(await accumulator),
|
||||||
[tankId]: calculateWN8((await tankAverages)[tankId].all, tankStats),
|
[tankId]: calculateWN8((await tankAverages)[tankId].all, tankStats),
|
||||||
};
|
};
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
const careerWN8s = await careerTankStatsRaw.reduce<
|
const careerWN8s = await careerTankStatsRaw.reduce<
|
||||||
PossiblyPromise<Record<number, number>>
|
PossiblyPromise<Record<number, number>>
|
||||||
>(async (accumulator, { tank_id }) => {
|
>(async (accumulator, { tank_id }) => {
|
||||||
return tank_id === 0 || (await tankAverages)[tank_id] === undefined
|
return tank_id === 0 || (await tankAverages)[tank_id] === undefined
|
||||||
? accumulator
|
? accumulator
|
||||||
: {
|
: {
|
||||||
...accumulator,
|
...(await accumulator),
|
||||||
[tank_id]: calculateWN8(
|
[tank_id]: calculateWN8(
|
||||||
(await tankAverages)[tank_id].all,
|
(await tankAverages)[tank_id].all,
|
||||||
careerStats[tank_id],
|
careerStats[tank_id],
|
||||||
|
|||||||
Reference in new issue
Block a user