don't mark goalies recorded unless at least one has been entered
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user