mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-07 21:15:19 +03:00
fix: ui: fix regenerateScreens, it was not updating the journal
And add to test suite. Fixes unreleased code.
This commit is contained in:
parent
778b660919
commit
3a0473b5b4
@ -347,10 +347,11 @@ resetScreens d ui@UIState{astartupopts=origopts, ajournal=j, aScreen=s,aPrevScre
|
||||
where
|
||||
topscreen' = screenUpdate origopts d j $ lastDef s ss
|
||||
|
||||
-- | Regenerate the content of the current and all parent screens
|
||||
-- from a new journal and reporting date (and current options),
|
||||
-- while preserving the screen navigation history.
|
||||
-- | Given a new journal and reporting date, save the new journal in the ui state,
|
||||
-- then regenerate the content of all screens in the stack
|
||||
-- (using the ui state's current options), preserving the screen navigation history.
|
||||
-- Note, does not save the reporting date.
|
||||
regenerateScreens :: Journal -> Day -> UIState -> UIState
|
||||
regenerateScreens j d ui@UIState{aopts=opts, aScreen=s,aPrevScreens=ss} =
|
||||
ui{aScreen=screenUpdate opts d j s, aPrevScreens=map (screenUpdate opts d j) ss}
|
||||
ui{ajournal=j, aScreen=screenUpdate opts d j s, aPrevScreens=map (screenUpdate opts d j) ss}
|
||||
|
||||
|
@ -213,3 +213,11 @@ which has nice screenshots, but might be less up to date.
|
||||
──────────────────────────── a:aa transactions (2/2) ───────────────────────────
|
||||
2021-01-02 a:aa 10 10
|
||||
2021-01-03 a:aa:aaa 100 110 # <- selected
|
||||
|
||||
** hledger-ui -f sample.journal saving, edit and change the "save" txn description and amount to "NEW" and $22, g # current screen shows new data after reload
|
||||
───────────── sample.journal account balances matching saving (1/1) ────────────
|
||||
assets:bank:saving $22
|
||||
|
||||
** RIGHT # newly created screens show new data after reload
|
||||
───────────── assets:bank:saving transactions matching saving (1/1) ────────────
|
||||
2008-06-02 NEW as:ba:saving $22 $22
|
||||
|
Loading…
Reference in New Issue
Block a user