 
 (declare reconciler)
 (defn handle-query-result [d]
-  (log "Handle Q R")
+  (do
+    (log "Handle Q R")
     ;; VERY TEMPORARY (KILL ME IF I DO NOT FIX IT)
     ;; Need to make difference between query for all comps. vs query for details for a comp.
-
-  (if (vector? d)
-    (let [clean-data  {:competitions d}      ;(uidb/sanitize (first d))
-          ]
-      (log "Compsss")
-      (om/transact! reconciler `[(app/add-competition ~clean-data) :app/competitions])
-      )
-    (let [clean-data (uidb/sanitize d)]
-      (log "Crazzzy")
-      (om/transact! reconciler `[(app/add-competition ~clean-data) :app/competitions]))))
+    
+    (if (vector? d)
+      (let [clean-data  {:competitions d}      ;(uidb/sanitize (first d))
+            ]
+        (log "Compsss")
+        (om/transact! reconciler `[(app/add-competition ~clean-data) :app/competitions])
+        )
+      (let [clean-data (uidb/sanitize d)]
+        (log "Crazzzy")
+        (om/transact! reconciler `[(app/add-competition ~clean-data) :app/competitions])))
+    (om/transact! reconciler `[(app/set-import-status {:status :none})]))
+  )
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Sente message handling

                                 (dom/form #js {:className "navbar-form navbar-right"}
                                           (dom/input #js {:type "text"
                                                           :className "form-control"
                                                           :placeholder "Search..."}))
                                 ;; (dom/div nil (make-button "Tävlingar" :competitions)   
                                 ;;          (dom/button
                                 ;;           #js {:onClick
                                 ;;                (fn [e]
                                 ;;                  (test-query-click this))}
                                 ;;           "Query")
                                 ;;          (when selected-competition
                                 ;;            (apply dom/div nil
                                 ;;                   (map (fn [[name key]] (make-button name key))
                                 ;;                        [["Properties" :properties]
                                 ;;                         ["Classes" :classes]
                                 ;;                         ["Time Schedule" :schedule]
                                 ;;                         ["Adjudicators" :adjudicators]
                                 ;;                         ["Adjudicator Panels" :adjudicator-panels]]))))
                                 )))

      (dom/div #js {:className "container-fluid"}
               (dom/div #js {:className "row"}
                        (when selected-competition
                          (dom/div #js {:className "col-sm-2 col-md-2 sidebar"}
                                   (dom/div nil (dom/u nil (:competition/name selected-competition)) )
                                   (apply dom/ul #js {:className "nav nav-sidebar"}

(defn init-app []
  (d/transact! conn [{:db/id -1 :app/id 1}
                     {:db/id -1 :selected-page :competitions}
                     {:db/id -1 :app/import-status :none}
                     {:db/id -1 :app/selected-competition {}}
                     ]))

(defn app-started? [conn]
