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.
This commit is contained in:
parent
03ec410862
commit
ca22b67d0e
|
@ -183,10 +183,6 @@
|
||||||
|
|
||||||
(def memo-communities-stack-items (atom nil))
|
(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
|
(defn- group-communities-by-status
|
||||||
[requests
|
[requests
|
||||||
{:keys [id]
|
{:keys [id]
|
||||||
|
@ -194,7 +190,8 @@
|
||||||
(cond
|
(cond
|
||||||
(:joined community) :joined
|
(:joined community) :joined
|
||||||
(boolean (get requests id)) :pending
|
(boolean (get requests id)) :pending
|
||||||
:else :opened))
|
(:spectated community) :opened
|
||||||
|
:else :other))
|
||||||
|
|
||||||
(re-frame/reg-sub
|
(re-frame/reg-sub
|
||||||
:communities/grouped-by-status
|
:communities/grouped-by-status
|
||||||
|
@ -216,7 +213,6 @@
|
||||||
;; any key.
|
;; any key.
|
||||||
(map #(dissoc % :members :chats :token-permissions :tokens-metadata))
|
(map #(dissoc % :members :chats :token-permissions :tokens-metadata))
|
||||||
(group-by #(group-communities-by-status requests %))
|
(group-by #(group-communities-by-status requests %))
|
||||||
merge-opened-communities
|
|
||||||
(map (fn [[k v]]
|
(map (fn [[k v]]
|
||||||
{k (sort-by (fn [{:keys [requested-to-join-at last-opened-at
|
{k (sort-by (fn [{:keys [requested-to-join-at last-opened-at
|
||||||
joined-at]}]
|
joined-at]}]
|
||||||
|
|
Loading…
Reference in New Issue