🔴 DisciplinesTab: activate/deactivate crash — gameState is undefined
#54
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
File:
src/components/game/tabs/DisciplinesTab.tsx, lines 111-117Inside
DisciplineCard,activateanddeactivateare called with only the disciplineid, butactivatein the store expects an optional secondgameStateargument. WhengameStateisundefined, thecanProceedDisciplinecheck insideactivatewill crash accessinggameState.elements.Impact: Runtime crash when clicking Activate/Pause buttons on discipline cards.
Fix: Pass the required game state (elements, rawMana) to the activate/deactivate calls, or modify the store's
activateto fetch game state internally from the relevant stores.[priority: 5] CRASH/BLOCKER — activate/deactivate crashes because gameState is undefined.
Fixed: Made
canProceedDiscipline()defensive —gameStateparam is now optional, returnstruewhen not provided (optimistic activation). Also madedisciplineStateparam optional. DisciplineTab now callsactivate(id)without gameState safely.