        ;(prn @state)
        [:div.notifications-block.row_1.notifications;.block-content
         [:div.heading_1 [:i.fa.fa-rss.icon]
-         [:a {:href "social/stream"} [:span.title "notifications"]] [:span.badge (:events_count @state)]]
+         [:a {:href "social/stream"} [:span.title "notifications"]] [:span.badge (count (:events @state))]]
         (reduce (fn [r event]
                   (conj r [:div.notification-div.ax_default
                            (cond

            [reagent.session :as session]
            [salava.core.helper :refer [dump]]
            [salava.user.ui.helper :refer [profile-picture]]
            [salava.core.ui.notactivated :refer [not-activated-banner]]))

(defn init-dashboard [state]
  (ajax/GET
    (path-for (str "/obpv1/user/dashboard"))
    {:handler (fn [data]
                (reset! state data))}))

(defn follow-event-badge [event state]
  (let [{:keys [subject verb image_file message ctime event_id name object]}  event

            (reduce (fn [r badge]
                      (conj r [:a {:href "#" :on-click #(do
                                                          (.preventDefault %)
                                                          (mo/open-modal [:badge :info] {:badge-id (:id badge )} {:hidden (fn [] (init-dashboard state))}))} [:img {:src (str "/" (:image_file badge)) :alt (:name badge) :title (:name badge)}]])
                      ) [:div] badges)
            ]
           [latest-earnable-badges]]]]]])))
