     (.click download-link)))
 
 
-(defn download-history-animation [blob]
+(defn download-history-animation [blob owner]
   (let [download-link (. js/document (getElementById "image-download-link"))]
-    (println "done!")
+    (om/set-state! owner :is-processing false)
     (set! (.-href download-link) (.createObjectURL js/URL blob))
     (.click download-link)))
 
-(defn export-history-animation []
+(defn export-history-animation [owner]
   (let [render-canvas (. js/document (createElement "canvas"))
         width (get-in @app/app-state [:main-app :canvas-width])
         height (get-in @app/app-state [:main-app :canvas-height])

                          :width (* width zoom-factor)
                          :height (* height zoom-factor)
                          :workerScript "./gifjs/dist/gif.worker.js"})]
    (dotimes [x (count app-history)]
      (let [history-snapshot (nth app-history x)
            image-data (get-in history-snapshot [:image-data])
            context (.getContext render-canvas "2d")]
        (canvasdrawing/draw-image-to-canvas image-data render-canvas width height zoom-factor)
        (.addFrame gif context #js {:copy true :delay 300})))
    (.on gif "finished" #(download-history-animation %))
    (.render gif)))




(defn menu-entry-component [entry owner]
  (reify
    om/IInitState
      (init-state [_]
        {:is-processing false
         :progress 0})

    om/IRenderState
      (render-state [this {:keys [clickchan]}]
        (omdom/div
          #js {:className "main-menu-item"
               :onClick (fn [e] (put! clickchan {:command (:command @entry)
                                                 :owner owner}))}
          (omdom/i #js {:className (:icon entry)})
          (if
            (om/get-state owner :is-processing)
            (str "Working... "(om/get-state owner :progress) "%")
            (:text entry))))))


(defn menu-component [app owner]
