fix empty community in the community list (#13199)
This commit is contained in:
parent
0a18f36623
commit
97bc388ad6
|
@ -49,8 +49,10 @@
|
||||||
{:events [::community-resolved]}
|
{:events [::community-resolved]}
|
||||||
[{:keys [db] :as cofx} community-id community]
|
[{:keys [db] :as cofx} community-id community]
|
||||||
(fx/merge cofx
|
(fx/merge cofx
|
||||||
{:db (community-resolved db community-id)
|
(cond-> {:db (community-resolved db community-id)}
|
||||||
:dispatch [::cache-link-preview-data (community-link community-id) community]}
|
(some? community)
|
||||||
|
(assoc :dispatch [::cache-link-preview-data
|
||||||
|
(community-link community-id) community]))
|
||||||
(models.communities/handle-community community)))
|
(models.communities/handle-community community)))
|
||||||
|
|
||||||
(fx/defn resolve-community-info
|
(fx/defn resolve-community-info
|
||||||
|
|
|
@ -84,7 +84,8 @@
|
||||||
|
|
||||||
(fx/defn handle-community
|
(fx/defn handle-community
|
||||||
[{:keys [db]} {:keys [id] :as community}]
|
[{:keys [db]} {:keys [id] :as community}]
|
||||||
{:db (assoc-in db [:communities id] (<-rpc community))})
|
(when id
|
||||||
|
{:db (assoc-in db [:communities id] (<-rpc community))}))
|
||||||
|
|
||||||
(fx/defn handle-communities
|
(fx/defn handle-communities
|
||||||
{:events [::fetched]}
|
{:events [::fetched]}
|
||||||
|
|
Loading…
Reference in New Issue