     (.on stream "end"
       (fn []
         (println "Download complete!")
-        (swap! app-state assoc :is-file-downloading? true)
+        (swap! app-state assoc :is-file-downloading? false)
         (swap! app-state assoc :download-progress nil)
         (swap! app-state assoc :data-downloaded 0)
 

      (do
        (.emit socket "file-download-request" (.-id music-info))
        (swap! app-state assoc :current-track-id (.-id music-info))
        (swap! app-state assoc :play-next-upload? false)))))

(.on (new js/ss socket) "file-download"
  (fn [stream track-id file-size]
    (println "Download starting!")
    (swap! app-state assoc :is-file-downloading? true)
    (.on stream "data"
      (fn [data-chunk]
        (let [size (+ (.-length data-chunk) (:data-downloaded @app-state))]

                          :current-track-id nil
                          :current-sound nil
                          :ball-being-dragged? false
                          :play-next-upload? false
                          :num-of-queued-download-requests 0}))

(enable-console-print!)

