       (.log js/console error)
       (do
         (lib/hide-add-form)
+        (lib/update-state-item! :layout :add-type (fn [_] nil))
         (ajax-get url)))))
 
 (defn init!

  (let [action (get-in @lib/app-state [:layout :add-type])]
    (cond
      (= action :add-start-statement) (post-statement statement reference :add-start-statement)
      (= action :add-start-premise)   (post-statement statement reference :add-start-premise)
      (= action :add-justify-premise) (post-statement statement reference :add-justify-premise)
      :else (println "Action not found:" action))))

(defn prepare-add

           :response-format :json
           :headers         (merge {"Content-Type" "application/json"}
                                   (token-header))
           :keywords?       true})))

(defn dispatch-add-action
  "Check which action needs to be performed based on the type previously stored in the app-state."
