Skip to content

Commit

Permalink
Bug causing module not to be set
Browse files Browse the repository at this point in the history
  • Loading branch information
ingsol committed Oct 3, 2018
1 parent e5402b3 commit 42e6acd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/cse_client/controller.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@

(k/reg-controller :module
{:params (fn [route]
(when (= :module (-> route :data :name))
(-> route :path-params :name)))
:start [::module-enter]})
(when (-> route :data :name (= :module))
(-> route :path-params :module)))
:start [::module-enter]
:stop [::module-leave]})

(k/reg-controller :websocket-controller
{:params (constantly true)
Expand Down Expand Up @@ -44,11 +45,11 @@

(k/reg-event-fx ::module-enter
(fn [{:keys [db]} [module]]
{:dispatch [::websocket/send socket-url (ws-request db {:module module})]}))
{:dispatch [::websocket/send socket-url (ws-request db {:command ["module" module]})]}))

(k/reg-event-fx ::module-leave
(fn [{:keys [db]} _]
{:dispatch [::websocket/send socket-url (ws-request db {:module nil})]}))
{:dispatch [::websocket/send socket-url (ws-request db {:command ["module" nil]})]}))

(k/reg-event-fx ::play
(fn [{:keys [db]} _]
Expand Down

0 comments on commit 42e6acd

Please sign in to comment.