       (aset input "value" "")
       (.focus input)
       (put! out-channel #js {:type "chat"
-                             :channel (name (:active-channel @app))
+                             :channel (name (first (:active-channel @app)))
                              :msg text}))))
 
 (defn msg-input-view [app owner]

                 :onKeyPress #(when (== (.-keyCode %) 13) (send-msg app owner))}]
        [:button {:on-click #(send-msg app owner)} "Send"]]))))

(defn channel-view [channel owner]
  (reify
    om/IRender
    (render [this]
      (sab/html
       [:div {:class (if (= (:active-channel @app-state) channel) "active" "")
              :on-click #(swap! app-state assoc :active-channel channel)}
         (str "#" (name channel))]))))

(defn channel-list-view [app owner]
  (reify

    (render-state [this state]
      (sab/html
       [:div.blue-shade.panel.channel-list
        (for [ch (keys (:channels app))]
          (om/build channel-view {:channel ch
                                  :active-channel (:active-channel app)}))]))))

(defn message-view [message owner]
  (reify
