From 9adffeb55f5925d8929f8c69e969ecae92a2e8d4 Mon Sep 17 00:00:00 2001 From: Andrea Maria Piana Date: Fri, 30 Nov 2018 13:04:25 +0100 Subject: [PATCH] Dont try to show current chat if nil Signed-off-by: Andrea Maria Piana --- .../ui/screens/profile/group_chat/views.cljs | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/src/status_im/ui/screens/profile/group_chat/views.cljs b/src/status_im/ui/screens/profile/group_chat/views.cljs index 781e8c5ffe..72496140a5 100644 --- a/src/status_im/ui/screens/profile/group_chat/views.cljs +++ b/src/status_im/ui/screens/profile/group_chat/views.cljs @@ -90,24 +90,25 @@ editing? [:get :group-chat-profile/editing?] changed-chat [:get :group-chat-profile/profile] current-pk [:account/public-key]] - (let [shown-chat (merge current-chat changed-chat) - admin? (admins current-pk)] - [react/view profile.components.styles/profile - [status-bar/status-bar] - (if editing? - [group-chat-profile-edit-toolbar] - [group-chat-profile-toolbar admin?]) - [react/scroll-view - [react/view profile.components.styles/profile-form - [profile.components/profile-header - {:contact shown-chat - :editing? editing? - :allow-icon-change? false - :on-change-text-event :group-chats.ui/name-changed}] - [list/action-list (actions admin? chat-id) - {:container-style styles/action-container - :action-style styles/action - :action-label-style styles/action-label - :action-separator-style styles/action-separator - :icon-opts styles/action-icon-opts}] - [members-list chat-id admin? (first admins) current-pk]]]]))) + (when current-chat + (let [shown-chat (merge current-chat changed-chat) + admin? (admins current-pk)] + [react/view profile.components.styles/profile + [status-bar/status-bar] + (if editing? + [group-chat-profile-edit-toolbar] + [group-chat-profile-toolbar admin?]) + [react/scroll-view + [react/view profile.components.styles/profile-form + [profile.components/profile-header + {:contact shown-chat + :editing? editing? + :allow-icon-change? false + :on-change-text-event :group-chats.ui/name-changed}] + [list/action-list (actions admin? chat-id) + {:container-style styles/action-container + :action-style styles/action + :action-label-style styles/action-label + :action-separator-style styles/action-separator + :icon-opts styles/action-icon-opts}] + [members-list chat-id admin? (first admins) current-pk]]]]))))