Skip to content

Commit

Permalink
Simplify FocusTransactions handling with mapM_
Browse files Browse the repository at this point in the history
  • Loading branch information
axman6 committed Jan 8, 2024
1 parent c9bba8b commit 1980535
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions up-top/src/Event.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,10 @@ handleEvent (VtyEvent e) = do
_ -> pure ()
ev -> case lz ^. focus of
FocusTransactions -> do
-- The id of the selected account
preuse (accounts . L.listSelectedElementL . to accountId) >>= \case
Nothing -> pure ()
Just aid ->
zoom (transactions . ix aid) $
L.handleListEventVi L.handleListEvent ev
-- The id of the selected account, if it exists
preuse (accounts . L.listSelectedElementL . to accountId) >>= mapM_ (\aid ->
zoom (transactions . ix aid) $
L.handleListEventVi L.handleListEvent ev)
FocusAccounts -> zoom accounts $ L.handleListEventVi L.handleListEvent ev
_ -> pure ()
HelpView ->
Expand Down

0 comments on commit 1980535

Please sign in to comment.