 (defn configure-ws [req]
   (let [{:keys [mode stream]} (:body req)
         caputre (-> req :resources :capture) ]
-    (dosync
       (swap! (:state caputre) assoc :mode (keyword mode))
-      (swap! state assoc :stream (keyword stream)))
-    (res {:msg "Statue Updated"})))
+    (res {:msg "State Updated"})))
 
 (defn init [req]
   (let [capture (-> req :resources :capture)

            [server.db.queries :as q]))

(timbre/refer-timbre)
(defonce state (atom { :stream :closed }))

(defn capture-ws [req]
  (let [capture (-> req :resources :capture)

       current-recording (q/find-active-recording conn) ]
    (res {:msg "init"
          :data {:mode (:mode @capture-state)
                 :patient-id 1
                 :current-recording current-recording}})))
