     (render [_]
       (dom/div #js {:className "thread"}
         (om/build new-message-view {:placeholder "Start a new conversation..."
-                                   :thread-id (uuid/make-random-squuid)})))))
+                                    :new-thread true
+                                    :thread-id (uuid/make-random-squuid)})))))
 
 (defn tag-view [tag owner]
   (reify

(ns chat.client.views
  (:require [om.core :as om]
            [om.dom :as dom]
            [chat.client.dispatcher :refer [dispatch!]]
            [chat.client.store :as store]))


                           :onKeyDown
                           (fn [e]
                             (when (and (= 13 e.keyCode) (= e.shiftKey false))
                               (let [text (.. e -target -value)
                                     tags (->> (re-seq tag-pattern text) (map second))
                                     tagless-text (string/replace text tag-pattern "")]
                                 (when (or (config :new-thread) (not (string/blank? tagless-text)))
                                   (dispatch! :new-message {:thread-id (config :thread-id)
                                                            :content tagless-text}))
                                 (when-not (empty? tags)
                                   (doseq [tag tags]
                                     (dispatch! :tag-thread {:thread-id (config :thread-id)
                                                             :tag-name tag}))))
                               (.preventDefault e)
                               (aset (.. e -target) "value" "")))})))))

