exit properly from delete menus

This commit is contained in:
Jonathan Lamothe 2020-03-12 23:52:40 -04:00
parent 65979329bd
commit fbaf2a1e60
2 changed files with 6 additions and 6 deletions

View File

@ -25,7 +25,7 @@ module Mtlstats.Control.EditGoalie (editGoalieC) where
import Control.Monad.Trans.State (gets, modify)
import Data.Maybe (fromMaybe)
import Lens.Micro ((^.), (%~))
import Lens.Micro ((^.), (.~), (%~))
import UI.NCurses as C
import Mtlstats.Actions
@ -110,9 +110,9 @@ deleteC _ = Controller
Just True -> do
gets (^.progMode.editGoalieStateL.egsSelectedGoalie) >>= mapM_
(\gid -> modify $ database.dbGoalies %~ dropNth gid)
modify editGoalie
modify edit
Just False -> modify editGoalie
Just False -> modify $ progMode.editGoalieStateL.egsMode .~ EGMenu
Nothing -> return ()
return True

View File

@ -23,7 +23,7 @@ module Mtlstats.Control.EditPlayer (editPlayerC) where
import Control.Monad.Trans.State (gets, modify)
import Data.Maybe (fromMaybe)
import Lens.Micro ((^.), (%~))
import Lens.Micro ((^.), (.~), (%~))
import qualified UI.NCurses as C
import Mtlstats.Actions
@ -101,9 +101,9 @@ deleteC _ = Controller
Just True -> do
gets (^.progMode.editPlayerStateL.epsSelectedPlayer) >>= mapM_
(\pid -> modify $ database.dbPlayers %~ dropNth pid)
modify editPlayer
modify edit
Just False -> modify editPlayer
Just False -> modify $ progMode.editPlayerStateL.epsMode .~ EPMenu
Nothing -> return ()
return True