fixed warnings.

This commit is contained in:
Bryce Covert
2019-04-17 08:11:57 -07:00
parent 2199e91c2a
commit b79fca113b

View File

@@ -316,8 +316,6 @@
[:p.buttons
[:a.button {:on-click (dispatch-event [::add-expense-account])} "Add"]]]]
(for [[index {:keys [account id location amount] :as expense-account}] (map vector (range) (:expense-accounts data))
:let [account (accounts-by-id (:id account))]]
^{:key id}
@@ -337,7 +335,7 @@
[:p.help "Expense Account"]
[:div.control.is-fullwidth
[bind-field
[typeahead {:matches (map (fn [x] [(:id x) (str (:numeric-code x) " - " (:name x))]) @(re-frame/subscribe [::subs/chooseable-expense-accounts]))
[typeahead {:matches (map (fn [x] [(:id x) (str (:numeric-code x) " - " (:name x))]) chooseable-expense-accounts)
:type "typeahead"
:field [:expense-accounts index :account :id]
:event [::change-expense-account-account]
@@ -345,12 +343,15 @@
[:div.column.is-narrow
[:p.help "Location"]
[:div.control
(if-let [forced-location (:location @(re-frame/subscribe [::subs/account (get-in data [:expense-accounts index :account :id])]))]
(if-let [forced-location (:location account)]
[:div.select
[:select {:disabled "disabled" :style {:width "5em"} :value forced-location} [:option {:value forced-location} forced-location]]]
[:div.select
[bind-field
[:select {:type "select"
:disabled (if (:location account)
"disabled"
"")
:style {:width "5em"}
:field [:expense-accounts index :location]
:allow-nil? true