diff --git a/src/cljs/auto_ap/subs.cljs b/src/cljs/auto_ap/subs.cljs index 742e31e8..4e88f621 100644 --- a/src/cljs/auto_ap/subs.cljs +++ b/src/cljs/auto_ap/subs.cljs @@ -77,12 +77,12 @@ (re-frame/reg-sub ::locations-for-client-or-bank-account (fn [db [_ client-id bank-account-id]] - (let [client (get (:clients db) (or client (:client db))) + (let [client (get (:clients db) (or client-id (:client db))) client-locations (:locations client) bank-account-locations (-> (by :id (:bank-accounts client)) (get bank-account-id) :locations)] - (or bank-account-locations client-locations)))) + (or (seq bank-account-locations) client-locations)))) (re-frame/reg-sub ::clients-by-id