From 52662ca965c6ba27a63cb84fac4843382e0e3d9a Mon Sep 17 00:00:00 2001 From: Bryce Date: Mon, 15 Apr 2024 20:41:42 -0700 Subject: [PATCH] Fixes selection --- .../auto_ap/views/components/expense_accounts_field.cljs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cljs/auto_ap/views/components/expense_accounts_field.cljs b/src/cljs/auto_ap/views/components/expense_accounts_field.cljs index 23a4b81d..eac2a8fe 100644 --- a/src/cljs/auto_ap/views/components/expense_accounts_field.cljs +++ b/src/cljs/auto_ap/views/components/expense_accounts_field.cljs @@ -82,8 +82,12 @@ (for [[before-account after-account] (map vector (concat original-expense-accounts (repeat nil)) expense-accounts)] (cond-> after-account - (not= (:id (:account before-account)) - (:id (:account after-account))) + (and + (not (:location (:account after-account))) + (= 1 (count locations))) + (assoc :location (first locations)) + + (:location (:account before-account)) (assoc :location nil) (not= (:amount-percentage before-account)