        [:button {:type "button" :class "btn btn-default"} "Unsave"]]]]))
 
 (defn main-html [posts]
-  [:div {:class "col-md-12"}
+  [:div {:class "col-md-10"}
    [:h4 "Saved Posts"]
    [:div {:class "list-group"}
     (for [p @posts]

                (set! (.-disabled (dommy/sel1 :#btn-get-posts)) true))
              (doseq [p posts]
                #_(println (process-json-post p))
                (swap! saved-posts #(conj % %2) (assoc (:data p) :key (str (-> p :data :name) (-> p :data :subreddit_id) (-> p :data :link_id))))))
            (handle-error (str error " " (:error-text response) "\nYour API token might've expired")))))))

(defn loggedin-html []
  [:p {:class "navbar-text navbar-right"} "Logged in as " (:username @app-state)])

(defn post-html [p]
  (let [link? (nil? (:title p))
        key (:key p)
        title (unescapeEntities (if link? (:link_title p) (:title p)))
        url (if link? (str (:link_url p) key) (:url p))
        body (if (not (nil? (:body_html p))) (unescapeEntities (:body_html p)))
        subreddit (:subreddit p)
        author (:author p)
        permalink (if link? (:link_url p) (str "https://www.reddit.com" (:permalink p)))
        created-on-epoch-local (+ (:created_utc p) (* 3600 (.getTimezoneOffset (js/Date.))))
        created-on-str (timef/unparse time-formatter (timec/from-long (* 1000 created-on-epoch-local)))]
    [:div {:class "panel panel-default"}
     [:div {:class "panel-heading"}
      [:h4 {:class "panel-title"}

                              :saved-for-reddit-app-state))

(def saved-posts (r/atom []))
(def subreddits (r/atom {}))

(def error-msg (r/atom ""))

(defn set-app-state-field [field value]
