Fix toggle-amount-mode: properly update request state with converted accounts and new mode

The assoc-in call had too many arguments, so the request state wasn't being
updated with the new mode or converted accounts. Using -> threading with
separate assoc-in calls ensures both the accounts and mode are properly set
before re-rendering the grid.
This commit is contained in:
2026-05-20 23:18:35 -07:00
parent 4739769297
commit 351659f8eb

View File

@@ -362,8 +362,9 @@
accounts (convert-accounts-mode (:transaction/accounts snapshot) old-mode new-mode total)]
(html-response
[:div#account-grid-body
(account-grid-body* (assoc-in request [:multi-form-state :snapshot :transaction/accounts] accounts
[:multi-form-state :snapshot :amount-mode] new-mode))])))
(account-grid-body* (-> request
(assoc-in [:multi-form-state :snapshot :transaction/accounts] accounts)
(assoc-in [:multi-form-state :snapshot :amount-mode] new-mode)))])))
(defrecord BasicDetailsStep [linear-wizard]
mm/ModalWizardStep