[fix] crash with creation and invitation to 1 letter group chat

Signed-off-by: yenda <eric@status.im>
This commit is contained in:
yenda 2019-02-11 14:25:05 +01:00
parent 48affbc918
commit aeb29e38b0
No known key found for this signature in database
GPG Key ID: 0095623C0069DCE6
1 changed files with 9 additions and 1 deletions

View File

@ -11,7 +11,15 @@
(when-not (string/blank? name) (when-not (string/blank? name)
[react/view (:default-chat-icon styles) [react/view (:default-chat-icon styles)
[react/text {:style (:default-chat-icon-text styles)} [react/text {:style (:default-chat-icon-text styles)}
(string/capitalize (second name))]])) ;; TODO: for now we check if the first letter is a #
;; which means it is most likely a public chat and
;; use the second letter if that is the case
;; a broader refactoring should clean up upstream params
;; for default-chat-icon
(string/capitalize (if (and (= "#" (first name))
(< 1 (count name)))
(second name)
(first name)))]]))
(defn dapp-badge [{:keys [online-view-wrapper online-view online-dot-left online-dot-right]}] (defn dapp-badge [{:keys [online-view-wrapper online-view online-dot-left online-dot-right]}]
[react/view online-view-wrapper [react/view online-view-wrapper