 (defn button-ajax
   "An ajax/ajax wrapper that releases the current managed-button after the API
   request.  Exists to faciliate migration away from stateful-button."
-  [method url message channel & {:keys [context params events] :as opts}]
-  (let [uuid frontend.async/*uuid*
-        c (chan)]
+  [method url message channel & opts]
+  (let [uuid frontend.async/*uuid*
+        c (chan)
+        events (:events opts)]
     (apply ajax/ajax method url message c opts)
     (go-loop []
-             (when-let [[_ status _ :as event] (<! c)]
-               (when-let [track-event (-> opts :events status)]
-                 (track-event))
-               (when (#{:success :failed} status)
-                 (release-button! uuid status))
-               (>! channel event)
-               (recur)))))
+      (when-let [[_ status _ :as event] (<! c)]
+        (when-let [track-event (-> events status)]
+          (track-event))
+        (when (#{:success :failed} status)
+          (release-button! uuid status))
+        (>! channel event)
+        (recur)))))
 
 ;; --- Navigation Multimethod Declarations ---
 

                 :events {:success #(analytics/track {:event-type :project-followed
                                                      :current-state current-state
                                                      :properties {:org org-name
                                                                   :repo repo-name}})})))


(defmethod control-event :inaccessible-org-toggled
  [target message {:keys [org-name value]} state]

(defmethod post-control-event! :deleted-project-api-token
  [target message {:keys [project-id token]} previous-state current-state]
  (let [project-name (vcs-url/project-name project-id)
        vcs-type (vcs-url/vcs-type project-id)
        api-ch (get-in current-state [:comms :api])]
    (ajax/ajax :delete
               (api-path/project-token vcs-type project-name token)
               :delete-project-api-token
               api-ch
               :context {:project-id project-id
