exit properly from delete menus
This commit is contained in:
parent
65979329bd
commit
fbaf2a1e60
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user