 
     (condp = (:screen @aurora-state)
       :notebooks (notebooks-list @aurora-state)
-      :pages (pages-list (-> @aurora-state :notebooks (get (:notebook @aurora-state))))
+      :pages (pages-list (from-index (:notebook @aurora-state)))
       :editor (editing-view))
     ]])
 



(defn click-add-page [e notebook]
  (add-page! (:id notebook) "untitled page"))

(defdom pages-list [notebook]
  [:ul {:className "pages"}
   (each [[name page] (filter #(get (-> % second :tags) :page) (:pages notebook))]
         (let [click (fn []
                       (swap! aurora-state assoc :page name :screen :editor :step [{:notebook (:notebook @aurora-state)
                                                                                    :page name
                                                                                    :step 0}]))]

           (if (input? (:id page))


(defdom notebooks-list [aurora]
  [:ul {:className "programs"}
   (each [notebook (from-index (:notebooks aurora))]
         (let [click (fn []
                       (swap! aurora-state assoc :notebook (:id notebook) :screen :pages))]
           (if (input? (:id notebook))
             [:li {:className "program-item"}
              [:input {:type "text" :defaultValue (:desc notebook)
                       :onKeyPress (fn [e]
                                     (when (= 13 (.-charCode e))
                                       (remove-input! (:id notebook))
                                       (update-index! notebook [] assoc :desc (.-target.value e))
                                       ))}]]
             [:li {:className "program-item"
                   :onContextMenu (fn [e]
                                    (add-input! (:id notebook) :desc)
                                    (.stopPropagation e)
                                    (.preventDefault e))
                   :onTouchStart click
                   :onClick click}
