From 97bc388ad64e9db319b34704aa26b0d69f8b1834 Mon Sep 17 00:00:00 2001 From: Parvesh Monu Date: Wed, 23 Mar 2022 21:53:23 +0530 Subject: [PATCH] fix empty community in the community list (#13199) --- src/status_im/chat/models/link_preview.cljs | 6 ++++-- src/status_im/communities/core.cljs | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/status_im/chat/models/link_preview.cljs b/src/status_im/chat/models/link_preview.cljs index 7fd2c4a09d..3459aca41d 100644 --- a/src/status_im/chat/models/link_preview.cljs +++ b/src/status_im/chat/models/link_preview.cljs @@ -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 diff --git a/src/status_im/communities/core.cljs b/src/status_im/communities/core.cljs index 9001ab59b8..bfdaa9577c 100644 --- a/src/status_im/communities/core.cljs +++ b/src/status_im/communities/core.cljs @@ -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]}