From ca22b67d0e82a3cb123be2174b3ef2157e676e08 Mon Sep 17 00:00:00 2001 From: Sean Hagstrom Date: Tue, 5 Nov 2024 14:18:14 -0800 Subject: [PATCH] fix: only display spectated communities in opened tab (#21548) This change resolves an issue with un-opened, joined, and pending communities being visible inside the "opened" communities tab. With this change, the "opened" community tab will only display spectated (opened) communities that have not been joined or pending to be joined. --- src/status_im/subs/communities.cljs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/status_im/subs/communities.cljs b/src/status_im/subs/communities.cljs index d43e043ed1..a7f197b2fd 100644 --- a/src/status_im/subs/communities.cljs +++ b/src/status_im/subs/communities.cljs @@ -183,10 +183,6 @@ (def memo-communities-stack-items (atom nil)) -(defn- merge-opened-communities - [{:keys [joined pending] :as assorted-communities}] - (update assorted-communities :opened concat joined pending)) - (defn- group-communities-by-status [requests {:keys [id] @@ -194,7 +190,8 @@ (cond (:joined community) :joined (boolean (get requests id)) :pending - :else :opened)) + (:spectated community) :opened + :else :other)) (re-frame/reg-sub :communities/grouped-by-status @@ -216,7 +213,6 @@ ;; any key. (map #(dissoc % :members :chats :token-permissions :tokens-metadata)) (group-by #(group-communities-by-status requests %)) - merge-opened-communities (map (fn [[k v]] {k (sort-by (fn [{:keys [requested-to-join-at last-opened-at joined-at]}]