mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
fix: first time tank deltas
This commit is contained in:
1 parent
15bec37a33
commit
ea1eeb4366
2 files changed
+7
-6
No files matched your search
@@ -1,4 +1,7 @@
|
||||
import { IndividualTankStats } from '../../types/tanksStats';
|
||||
import {
|
||||
emptyIndividualTankStats,
|
||||
IndividualTankStats,
|
||||
} from '../../types/tanksStats';
|
||||
|
||||
export function deltaTankStats(
|
||||
tanksA: IndividualTankStats[],
|
||||
@@ -6,8 +9,8 @@ export function deltaTankStats(
|
||||
) {
|
||||
return tanksB
|
||||
.map((b) => {
|
||||
const a = tanksA.find((a) => a.tank_id === b.tank_id);
|
||||
if (!a) return null;
|
||||
const a =
|
||||
tanksA.find((a) => a.tank_id === b.tank_id) ?? emptyIndividualTankStats;
|
||||
|
||||
return {
|
||||
account_id: b.account_id,
|
||||
|
||||
Reference in new issue
Block a user