         (om/build-all message-view (:messages data))))
     om/IDidUpdate
       (did-update [_ _ _]
-        (let [div (js/$ "#messages")]
-          (.scrollTop div (.prop div "scrollHeight"))))))
+        (if (:message-received @app-state)
+          (let [div (js/$ "#messages")]
+            (.scrollTop div (.prop div "scrollHeight"))
+            (swap! app-state assoc :message-received false))))))
 
 (defn file-upload-progress-view [data owner]
   (reify


(.on socket "chat message"
  (fn [message]
    (swap! app-state assoc :messages (conj (:messages @app-state) message))))

(.on socket "userslist"
  (fn [users]

                          :upload-progress nil
                          :data-uploaded 0
                          :current-file-download nil
                          :current-download-stream-id (new js/Blob)
                          :message-received false}))

(enable-console-print!)

