Display contact bar for user not in contacts

Signed-off-by: Julien Eluard <julien.eluard@gmail.com>
This commit is contained in:
Andrea Maria Piana 2018-03-15 14:30:50 +00:00 committed by Julien Eluard
parent fa26381407
commit 9533d158f7
No known key found for this signature in database
GPG Key ID: 6FD7DB5437FCBEF6
1 changed files with 3 additions and 2 deletions

View File

@ -37,7 +37,8 @@
(defview add-contact-bar []
(letsubs [chat-id [:get-current-chat-id]
pending-contact? [:current-contact :pending?]]
(when pending-contact?
(when (or (nil? pending-contact?) ; user not in contact list
pending-contact?)
[react/touchable-highlight
{:on-press #(re-frame/dispatch [:add-contact chat-id])}
[react/view style/add-contact
@ -59,7 +60,7 @@
[toolbar/actions [{:icon :icons/options
:icon-opts {:color :black}
:handler #(on-options chat-id name group-chat public?)}]]]
[add-contact-bar]]))
(when-not (or public? group-chat) [add-contact-bar])]))
(defmulti message-row (fn [{{:keys [type]} :row}] type))