From 254fd229b50ad84e55de57133cffe262adf46cad Mon Sep 17 00:00:00 2001 From: Andrea Maria Piana Date: Wed, 3 Jun 2020 11:47:05 +0200 Subject: [PATCH] [Fixes #10746] Correctly show reply symbol Signed-off-by: Andrea Maria Piana --- src/status_im/ui/screens/chat/utils.cljs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/status_im/ui/screens/chat/utils.cljs b/src/status_im/ui/screens/chat/utils.cljs index ce25f66ef0..7d316075bd 100644 --- a/src/status_im/ui/screens/chat/utils.cljs +++ b/src/status_im/ui/screens/chat/utils.cljs @@ -4,9 +4,13 @@ [status-im.ui.components.react :as react] [status-im.ui.components.colors :as colors])) +(def ^:private reply-symbol "↪ ") + (defn format-author [contact-name style] (let [additional-styles (style false)] - (if (= (aget contact-name 0) "@") + (if (or (= (aget contact-name 0) "@") + ;; in case of replies + (= (aget contact-name 1) "@")) (let [trimmed-name (subs contact-name 0 81)] [react/text {:number-of-lines 2 :style (merge {:color colors/blue @@ -20,10 +24,8 @@ :font-weight "400"} additional-styles)} contact-name]))) -(def ^:private reply-symbol "↪ ") - (defn format-reply-author [from username current-public-key style] (or (and (= from current-public-key) [react/text {:style (style true)} (str reply-symbol (i18n/label :t/You))]) - (format-author username style))) + (format-author (str reply-symbol username) style)))