 
              (om/update! (registered-state-cur current-index) [0] :unregistered))))))
 
+(defn- unregister-repo [current-index auth-token repo-name]
+  (let [unregister-repo-url (str/format "/api/user/%s/unregister" repo-name)]  
+    (go (let [resp (<! (http/post unregister-repo-url {:oauth-token auth-token
+                                                       :json-params {}}))]
+           (when (= 200 (:status resp))
+              (swap! app-state (fn [state] (update-in state [:repos current-index] dissoc :registered)))
+              (om/update! (registered-state-cur current-index) [0] :unregistered))))))  
+  
 ;; {:auth - :repo -}
 (defn repo-config-panel [state owner]
   (reify

            repos (:repos @app-state)]
        (if (< current-index (count repos))
          (om/build repo-config-panel {:index current-index
                                       :auth (:auth state)})                              
          (dom/h2 nil "Add your repos"))))))

(defn widget [state owner]

                         (fn [e] (om/update! (current-index-cur) [0] index))}
                  (get repo "full_name")))]
        (apply dom/div nil
          (map-indexed repo-button (:repos @app-state)))))))

(defn- register-repo [current-index auth-token repo-name]
  (let [register-repo-url (str/format "/api/user/%s/register" repo-name)]  
