Commit af10f53
fix(score): post-game modal — return credited delta, not state total
ScoreSuccess.resources je type-doc-ovaný ako "credited resource delta",
ale BE vracal credit.resources (= total state.resources po pripočítaní).
PostGameBreakdown chip-y to renderovali ako "+98691 watts" namiesto
skutočnej +12 watts delty z hry.
- app/api/score/route.ts:172 — resources = trimmed (delta), nie credit.resources (total)
- app/api/score/route.ts:107 — narrow type na Partial<Record<ResourceKey, number>>
User-trust kritické: bez fix-u modal sľuboval desaťtisíce zdrojov ktoré
sa nezhmotnili v reálnom stave.
Tests: typecheck clean, lint 0 errors, vitest 719/719 pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 91bf026 commit af10f53
1 file changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
173 | 177 | | |
174 | 178 | | |
175 | 179 | | |
| |||
0 commit comments