Dont try to show current chat if nil

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
This commit is contained in:
Andrea Maria Piana 2018-11-30 13:04:25 +01:00
parent 22167db7a2
commit 9adffeb55f
No known key found for this signature in database
GPG Key ID: AA6CCA6DE0E06424
1 changed files with 22 additions and 21 deletions

View File

@ -90,24 +90,25 @@
editing? [:get :group-chat-profile/editing?] editing? [:get :group-chat-profile/editing?]
changed-chat [:get :group-chat-profile/profile] changed-chat [:get :group-chat-profile/profile]
current-pk [:account/public-key]] current-pk [:account/public-key]]
(let [shown-chat (merge current-chat changed-chat) (when current-chat
admin? (admins current-pk)] (let [shown-chat (merge current-chat changed-chat)
[react/view profile.components.styles/profile admin? (admins current-pk)]
[status-bar/status-bar] [react/view profile.components.styles/profile
(if editing? [status-bar/status-bar]
[group-chat-profile-edit-toolbar] (if editing?
[group-chat-profile-toolbar admin?]) [group-chat-profile-edit-toolbar]
[react/scroll-view [group-chat-profile-toolbar admin?])
[react/view profile.components.styles/profile-form [react/scroll-view
[profile.components/profile-header [react/view profile.components.styles/profile-form
{:contact shown-chat [profile.components/profile-header
:editing? editing? {:contact shown-chat
:allow-icon-change? false :editing? editing?
:on-change-text-event :group-chats.ui/name-changed}] :allow-icon-change? false
[list/action-list (actions admin? chat-id) :on-change-text-event :group-chats.ui/name-changed}]
{:container-style styles/action-container [list/action-list (actions admin? chat-id)
:action-style styles/action {:container-style styles/action-container
:action-label-style styles/action-label :action-style styles/action
:action-separator-style styles/action-separator :action-label-style styles/action-label
:icon-opts styles/action-icon-opts}] :action-separator-style styles/action-separator
[members-list chat-id admin? (first admins) current-pk]]]]))) :icon-opts styles/action-icon-opts}]
[members-list chat-id admin? (first admins) current-pk]]]]))))