Skip to content

Commit

Permalink
Fix issue with stale state on upload form
Browse files Browse the repository at this point in the history
  • Loading branch information
verma committed May 3, 2014
1 parent a141d4d commit 18c9c62
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src-cljs/dakait/components.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,21 @@

om/IDidMount
(did-mount [this]
(.modal ($ (om/get-node owner)) #js {:keyboard false
:show false
:backdrop "static"})
(go (loop []
(<! pusher-modal-chan)
(log "Got request to show pusher modal")
(.modal ($ (om/get-node owner)) "show")
(recur))))
(let [$modal ($ (om/get-node owner))
url (om/get-node owner "url")]
(.modal $modal #js {:keyboard false
:show false
:backdrop "static"})
(.on $modal "shown.bs.modal" (fn []
(.focus url)))
(go (loop []
(<! pusher-modal-chan)
(log "Got request to show pusher modal")
(om/set-state! owner :processing false)
(om/set-state! owner :error false)
(set! (.-value url) "")
(.modal $modal "show")
(recur)))))
om/IRenderState
(render-state [_ state]
(let [close-dialog #(.modal ($ (om/get-node owner)) "hide")
Expand Down

0 comments on commit 18c9c62

Please sign in to comment.