ui: after exiting --register, select that account

This commit is contained in:
Simon Michael 2015-09-03 20:51:05 -07:00
parent 472b0aee75
commit ebc4022888
2 changed files with 5 additions and 4 deletions

View File

@ -4,7 +4,9 @@
{-# LANGUAGE RecordWildCards #-}
module Hledger.UI.AccountsScreen
(screen)
(screen
,initAccountsScreen
)
where
import Control.Lens ((^.))

View File

@ -101,13 +101,12 @@ runBrickUi uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} j = do
$ filter (regexMatches apat) $ journalAccountNames j
-- Initialising the accounts screen is awkward, requiring
-- another temporary AppState value..
ascr = AS.screen
ascr' = aScreen $
(sInitFn ascr) d
AS.initAccountsScreen (Just acct) d -- acct will be selected
AppState{
aopts=uopts'
,ajournal=j
,aScreen=ascr
,aScreen=AS.screen
,aPrevScreens=[]
}