don't mark goalies recorded unless at least one has been entered

This commit is contained in:
Jonathan Lamothe
2019-11-04 01:24:33 -05:00
parent b0cf9a83a1
commit 3f38160abd
3 changed files with 25 additions and 1 deletions

View File

@@ -37,6 +37,7 @@ module Mtlstats.Actions
, addGoalie
, resetCreatePlayerState
, resetCreateGoalieState
, finishGameGoalieEntry
, recordGoalAssists
, awardGoal
, awardAssist
@@ -200,6 +201,11 @@ resetCreateGoalieState = progMode.createGoalieStateL
%~ (cgsNumber .~ Nothing)
. (cgsName .~ "")
-- | Attempts to finish game goalie entry
finishGameGoalieEntry :: ProgState -> ProgState
finishGameGoalieEntry s = s & progMode.gameStateL.goaliesRecorded
.~ not (null $ s^.progMode.gameStateL.gameGoalieStats)
-- | Awards the goal and assists to the players
recordGoalAssists :: ProgState -> ProgState
recordGoalAssists ps = fromMaybe ps $ do