 (reg-event-fx
   :hide-thread
   (fn [{state :db :as cofx} [_ {:keys [thread-id local-only?]}]]
-    (merge
-      {:db (helpers/hide-thread state thread-id)}
-      (when-not local-only?
-        {:websocket-send (list [:braid.server/hide-thread thread-id])}))))
+    {:db (helpers/hide-thread state thread-id)
+     :websocket-send (when-not local-only?
+                       (list [:braid.server/hide-thread thread-id]))}))
 
 (reg-event-fx
   :reopen-thread

(reg-event-fx
  :set-group-intro
  (fn [{state :db :as cofx} [_ {:keys [group-id intro local-only?] :as args}]]
    (merge
      {:db (helpers/set-group-intro state group-id intro)}
      (when-not local-only?
        {:websocket-send (list [:braid.server/set-group-intro args])}))))

(reg-event-fx
  :set-group-avatar
  (fn [{state :db :as cofx} [_ {:keys [group-id avatar local-only?] :as args}]]
    (merge
      {:db (helpers/set-group-avatar state group-id avatar)}
      (when-not local-only?
        {:websocket-send (list [:braid.server/set-group-avatar args])}))))

(reg-event-fx
  :make-group-public!

(reg-event-fx
  :set-window-visibility
  (fn [{state :db :as cofx} [_ visible?]]
    {:db (helpers/set-window-visibility state visible?)
     :window-title (when visible? "Chat")}))

(reg-event-fx
  :auth
