 
 (defn toggle-district! [d]
   (swap! app-state update :selected-districts
-         #(if (% d) (disj % d) (conj % d))))
+         #(do (when (and (= d @db/selected-district) (% d))
+                (reset! db/selected-district nil))
+              (if (% d) (disj % d) (conj % d)))))
 
 (defn selected-districts []
   (:selected-districts @app-state))


(defn add-idea-component []
  [:div
   [bind-fields
    idea-template
    idea-doc
    #_ (fn [k v _] (prn k v _))]
   [:button.btn.btn-default

                     errors (validate-user after)]
                 (assoc after :errors errors)))]

         [:button.btn.btn-primary
          {:on-click #(when (validate-user! user-doc) (submit! @user-doc))}
          (snippet :submit)]])])])
