From c2a5808d0c23d50524706ec6b37a1691f85bedec Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Mon, 14 May 2018 09:50:53 -0700 Subject: [PATCH] only clickable at the right moment. --- src/cljs/auto_ap/views/pages/unpaid_invoices.cljs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/cljs/auto_ap/views/pages/unpaid_invoices.cljs b/src/cljs/auto_ap/views/pages/unpaid_invoices.cljs index af7cb1b4..109bf890 100644 --- a/src/cljs/auto_ap/views/pages/unpaid_invoices.cljs +++ b/src/cljs/auto_ap/views/pages/unpaid_invoices.cljs @@ -88,11 +88,17 @@ (def unpaid-invoices-page (with-meta (fn [] - (let [checked (:checked @(re-frame/subscribe [::invoice-page]))] + (let [checked (:checked @(re-frame/subscribe [::invoice-page])) + current-company @(re-frame/subscribe [::subs/company])] [:div [:h1.title "Unpaid invoices"] [:div.is-pulled-right - [:button.button.is-primary {:on-click (dispatch-event [::print-checks ])} "Print check(s)"]] + (when current-company + [:button.button.is-primary {:on-click (dispatch-event [::print-checks ]) + :disabled (if (seq checked) + "" + "disabled") + } "Print check(s)"])] [invoice-table {:id :unpaid :params (re-frame/subscribe [::params])