               (filter (fn [tag] (= (get-in @state [:open-group-id]) (tag :group-id)))))
             (vals (get-in @state [:tags]))))))
 
-(reg-sub-raw
+(reg-sub
   :user-avatar-url
   (fn [state _ [user-id]]
-    (reaction (get-in @state [:users user-id :avatar]))))
-
-(reg-sub-raw
+    (get-in state [:users user-id :avatar])))
+
+(reg-sub
   :user-status
   (fn [state _ [user-id]]
-    (reaction (get-in @state [:users user-id :status]))))
-
-(reg-sub-raw
+    (get-in state [:users user-id :status])))
+
+(reg-sub
   :search-query
   (fn [state _]
-    (reaction (get-in @state [:page :search-query]))))
+    (get-in state [:page :search-query])))
 
 (reg-sub-raw
   :tags-for-thread

    ; depend on page & group, so when the page changes this sub updates too
    (.getPath (.parse Uri js/window.location))))

(reg-sub-raw
  :thread
  (fn [state _ [thread-id]]
    (reaction (get-in @state [:threads thread-id]))))

(reg-sub-raw
  :threads
  (fn [state _]
    (reaction (@state :threads))))

(reg-sub-raw
  :page-id
  (fn [state _]
    (reaction (get-in @state [:page :id]))))

(reg-sub-raw
  :open-threads

  (fn [[groups group-order] _]
    (order-groups groups group-order)))

(reg-sub
  :group-bots
  (fn [state _ [group-id]]
    (get-in state [:groups group-id :bots])))

(reg-sub
  :user
  (fn [state [_ q-user-id] [d-user-id]]
    (let [user-id (or d-user-id q-user-id)]
      (if-let [u (get-in state [:users user-id])]
        u
        (let [g-id (state :open-group-id)
              group-bots (get-in state [:groups g-id :bots])]
          (-> group-bots
              (->> (filter (fn [b] (= (b :user-id) user-id))))
              first
              (assoc :bot? true)))))))

(reg-sub
  :users
  (fn [state _]
    (state :users)))

(reg-sub
  :user-is-group-admin?
  (fn [state _ [user-id group-id]]
    (contains? (get-in state [:groups group-id :admins]) user-id)))

(reg-sub
  :current-user-is-group-admin?
  (fn [state _ [group-id]]
    (->> (get-in state [:session :user-id])
         (contains? (set (get-in state [:groups group-id :admins]))))))

(reg-sub
  :open-thread-ids
  (fn [state _]
    (get-in state [:user :open-thread-ids])))

(reg-sub-raw
  :group-unread-count
