 
 (.on socket "chat-message"
   (fn [message]
+    (println "Received chat-message signal:" message)
     (swap! app-state assoc :messages (conj (:messages @app-state) message))
     (swap! app-state assoc :message-received? true)))
 
 (.on socket "users-list"
   (fn [users]
+    (println "Received users-list signal: " users)
     (swap! app-state assoc :users users)))
 
 (.on socket "file-upload-info"
   (fn [file-upload-info]
+    (println "Received file-upload-info signal: " file-upload-info)
+
     (if (= (.-totalsize file-upload-info) (.-bytesreceived file-upload-info))
       (swap! app-state assoc :current-uploads-info
         (dissoc (:current-uploads-info @app-state) (.-id file-upload-info)))


(.on socket "track-change"
  (fn [track-id sound-id]
    (println "CHANGING TO TRACK " track-id)
    (let [last-current-track-id (:current-track-id @app-state)
          last-current-sound-id (:current-sound-id @app-state)]
      (swap! app-state assoc :current-track-id track-id)

                               #js {:type "audio/mpeg"})}))))
    (.on stream "end"
      (fn []
        (println "Download of" track-id "complete!")
        (swap! app-state assoc :download-status (merge (:download-status @app-state)
                                                       {track-id :complete}))

