    :minimum-size [400 :by 60]))
 
 
-(defn update-fa-post-widget [e form]
+(defn update-fa-post-widget [form e]
   ;; TODO use cond
   (if (= :wait (:value e))
     (config! (select form [:#faprog]) :indeterminate? true)

                         (config! (select form [:#publish-btn]) :user-data full-posts)
                         ))))))

(defn setup-events [form event-chan map-stream]
  (listen (select form [:#publish-btn])
          :mouse-clicked (fn [e]
                           (when-let [posts (config (select form [:#publish-btn]) :user-data)]
                             (let [c (async/chan)]
                               (when (not (empty? posts))
                                 (posts/send-aw-posts-to-fa-server posts c)
                                 (async/go
                                   (let [res (async/<! c)]
                                     (if (= :error (:id res))
                                       (show! (pack!
                                               (dialog :content
                                                       (str "Failed to send: " (:value res)))))
                                       (show! (pack!
                                               (dialog :content
                                                       (str "Successfully sent " (:value res) " posts"))))))))))))

  ;; setup 'latest post' label and progressbar
  (map-stream #(= :fa-post (:id %)) #(update-fa-post-widget % form))
  ;; when fa post is retrived, start fetching aw posts
  (map-stream #(and (= :fa-post (:id %)) (map? (:value %))) #(fetch-aw-posts % form)))

(defn launch-tab [event-chan]
  (let [c (async/chan)]

      (config! (select form [:#latest-fa-post]) :visible? true)
      )))

(defn fetch-aw-posts [form e]
  (let [c (async/chan)
        content-chan (async/chan)
        fa-post (:value e)]
