 (def token-key "gitique.github_access_token")
 (def state (atom {:selected-commits '()
                   :current-pr nil}))
+
+(def pjax-wrapper (dom/getElement "js-repo-pjax-container"))
 
 (declare add-icons! get-new-commits! update-icons!)
 (declare log maybe-show-new)

  (let [enabled? (= state "new")
        other-state (if enabled? "all" "new")
        to-enable (dom/getElement (str "gitique-show-" state))
        to-disable (dom/getElement (str "gitique-show-" other-state))
        wrapper (dom/getElement "js-repo-pjax-container")]
    (.add (.-classList to-enable) "selected")
    (.remove (.-classList to-disable) "selected")
    (if (= state "new")
      (.add (.-classList wrapper) "gitique-enabled")
      (.remove (.-classList wrapper) "gitique-enabled"))
    (update-overall!)))

(defn- add-button! []

    (reduce + numbers)))

(defn- update-overall! []
  (let [gitique-enabled (.contains (.-classList pjax-wrapper) "gitique-enabled")
        selector (str "#files .file" (when gitique-enabled ":not(.gitique-hidden)"))
        file-count (count (js/document.querySelectorAll selector))
        added (diffstat-count gitique-enabled "added")
