fix empty community in the community list (#13199)

This commit is contained in:
Parvesh Monu 2022-03-23 21:53:23 +05:30 committed by GitHub
parent 0a18f36623
commit 97bc388ad6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -49,8 +49,10 @@
{:events [::community-resolved]}
[{:keys [db] :as cofx} community-id community]
(fx/merge cofx
{:db (community-resolved db community-id)
:dispatch [::cache-link-preview-data (community-link community-id) community]}
(cond-> {:db (community-resolved db community-id)}
(some? community)
(assoc :dispatch [::cache-link-preview-data
(community-link community-id) community]))
(models.communities/handle-community community)))
(fx/defn resolve-community-info

View File

@ -84,7 +84,8 @@
(fx/defn handle-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
{:events [::fetched]}