           (for [{:keys [component view]} dataviews]
             [:div {:class (str "tab-page " (name view) "-page")
                    :style {:display (view->display view)}}
-             (when (= active-view view)
+             (when (= selected view)
                [:div.tab-content {:id (str "tab-content" (name view))}
                 (om/build component app-state {:opts opts})])])])))))

   :settings {:view :settings
              :label "Settings"
              :component settings-page}})

(defmethod dataview-actions :default
  [cursor owner]

(defmethod tabbed-dataview :default
  [app-state owner opts]
  (reify
    om/IRender
    (render [_]
      (let [{:keys [is-encrypted? is-within-pricing-limits?]
             {:keys [active selected]} :views} app-state
            view->display #(if (= selected %) "block" "none")
            view->cls #(when (= selected %) "clicked")
            dataviews (->> app-state :views :all
                           (map dataview-map) (remove nil?))
            dv->link (fn [{:keys [view label]}]
                       (let [active? (some #(= view %) active)]
                         (if active?
                           [:a {:class (view->cls view)
                                :href (str "#/" (name view))} label]
                           (view->inactive-tab view
                                               label
                                               is-encrypted?
                                               is-within-pricing-limits?))))]
        (html
         [:div.tab-container.dataset-tabs
          [:div.tab-bar
