From fbaf2a1e60ba70c0a04c8dd2530f7b6fa7b4ead9 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Thu, 12 Mar 2020 23:52:40 -0400 Subject: [PATCH] exit properly from delete menus --- src/Mtlstats/Control/EditGoalie.hs | 6 +++--- src/Mtlstats/Control/EditPlayer.hs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Mtlstats/Control/EditGoalie.hs b/src/Mtlstats/Control/EditGoalie.hs index 3bca300..7632084 100644 --- a/src/Mtlstats/Control/EditGoalie.hs +++ b/src/Mtlstats/Control/EditGoalie.hs @@ -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 diff --git a/src/Mtlstats/Control/EditPlayer.hs b/src/Mtlstats/Control/EditPlayer.hs index 90e5b7c..5fe1d96 100644 --- a/src/Mtlstats/Control/EditPlayer.hs +++ b/src/Mtlstats/Control/EditPlayer.hs @@ -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