   (reify
     om/IInitState
     (init-state [_]
-      {:comm (chan)})
+      {:comm (chan)
+       :loading false})
     om/IWillMount
     (will-mount [_]
-      (let [comm (om/get-state owner :comm)
-            core-comm (om/get-state owner :core-comm)]
-        (go
+      (when (empty? (:geolocation data))
+        (om/set-state! owner :loading true))
+      (go
+        (let [loc (<! (get-geolocation))]
+          (om/update! data [:geolocation] loc))
+        (om/set-state! owner :loading false))
+      (go
+        (let [comm (om/get-state owner :comm)
+              core-comm (om/get-state owner :core-comm)]
           (while true
             (let [[msg msg-data] (<! comm)]
               (case msg



(def app-state
  {:channels {}
   :geolocation nil})

(def routes ["new" ::new])

    om/IRenderState
    (render-state [_ {:keys [comm]}]
      (let [m {:init-state {:comm comm}}]
        (if (om/get-state owner :loading)
          (om/build loading nil)
          (case page
            ::new (om/build new-channel nil m)
            ::home (om/build channel-list {:params params :data data} m)))))))
