Compare commits

...
4 Commits
Author SHA1 Message Date
TrèsAbhi 763ecf22b0 New Crowdin updates (#266) 2026-09-24 16:25:00 -05:00
TrèsAbhi 2beb084b67 Merge pull request #267 from Hitjack007/fix/session-missing-average-crash 2026-09-24 14:07:50 -07:00
tresabhi f7ca622906 correct assertions 2026-09-24 16:07:12 -05:00
Mark Greene 88643d366d Fix: skip session delta entries with no tank definition or average
The /session/ page crashed when a tracked player's tank stats included
a tank with no matching tank definition or no average stats (WN8
baseline). The delta memo dereferenced `tank.id` on a possibly missing
definition and forced `average?.mu!` through as non-null, so a missing
average threw inside `compositeStats`/`calculateWN8` uncaught, breaking
the page on every load while the bad state persisted in localStorage.

Skip those entries instead of crashing: entries with no tank
definition or no average `mu` are dropped from the delta via
`flatMap`, so the rest of the session table still renders.
2026-09-23 08:21:16 +12:00
2 changed files with 19 additions and 13 deletions

No files matched your search

+10 -10
View File
@@ -13,7 +13,7 @@
"hp": "{value}од",
"x": "x{value}",
"percentage": "{value}%",
"deg_s": "{value}град/c",
"deg_s": "{value}°/c",
"plus": "+{value}"
},
"gun_types": {
@@ -37,8 +37,8 @@
"d_1": "Вчора"
},
"branches": {
"beta": "Beta",
"development": "Development",
"beta": "Бета",
"development": "Розробка",
"opentest": "Відкритий тест",
"preview": "Preview",
"production": "Production"
@@ -340,8 +340,8 @@
},
"mixer": {
"name": "Mixer",
"button": "Mix and match",
"description": "Mix tank modules",
"button": "Змішувати та поєднувати",
"description": "Змішані танкові модулі",
"seo_description": "Mix and match hulls, turrets, and guns of tanks in World of Tanks Blitz",
"screenshot": "Знімок екрану",
"randomize": "Рандомізувати"
@@ -501,11 +501,11 @@
"tech_tree": {
"title": "Звичайний",
"battle": "1 бій",
"battles": "{count} battles",
"battles": "{count} битви",
"route": "Route {index} of {count}"
},
"game_modes": {
"title": "Game mode abilities"
"title": "Здібності ігрового режиму"
},
"review": {
"title": "Review videos",
@@ -626,7 +626,7 @@
"camouflageShootingStill": "Нерухомо",
"camouflageShootingMoving": "У русі",
"camouflageCaughtOnFire": "Caught on fire",
"width": "Width",
"width": "Ширина",
"height": "Height",
"length": "Length",
"volume": "Volume",
@@ -740,7 +740,7 @@
}
},
"gallery": {
"name": "Gallery",
"name": "Галерея",
"button": "Browse all",
"description": "Blitz player avatars",
"seo_description": "Усі World of Tanks Blitz аватари гравців",
@@ -843,7 +843,7 @@
"breakdown": {
"name": "Breakdown",
"options": {
"width": "Width",
"width": "Ширина",
"height": "Height",
"showTotal": "Show total",
"listGap": "List gap",
@@ -90,15 +90,21 @@ function Content() {
session.tracking && tankStatsB
? deltaTankStats(session.player.stats, tankStatsB)
.sort((a, b) => b.last_battle_time - a.last_battle_time)
.map((entry) => {
.flatMap((entry) => {
if (!(entry.tank_id in tankDefinitions.tanks)) return [];
const tank = tankDefinitions.tanks[entry.tank_id];
if (!(tank.id in averageDefinitions.averages)) return [];
const average = averageDefinitions.averages[tank.id];
const composite = compositeStats(
{ ...entry.all, battle_life_time: entry.battle_life_time },
average?.mu!,
average.mu!,
);
return { tank, composite };
return [{ tank, composite }];
})
: undefined,
[session.tracking && session.player, tankStatsB],