Skip to content

Commit ff4a8d7

Browse files
committed
fixup! WIP
1 parent b980fe3 commit ff4a8d7

File tree

4 files changed

+25
-10
lines changed

4 files changed

+25
-10
lines changed

src/status_im/subs.cljs

+15
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,21 @@
452452
(fn [{:keys [public-key]}]
453453
public-key))
454454

455+
(re-frame/reg-sub
456+
:multiaccount/preferred-name
457+
:<- [:multiaccount]
458+
(fn [{:keys [preferred-name]}]
459+
preferred-name))
460+
461+
(re-frame/reg-sub
462+
:multiaccount/my-name
463+
:<- [:multiaccount/public-key]
464+
:<- [:multiaccount/preferred-name]
465+
(fn [[identity preferred-name]]
466+
(if preferred-name
467+
(stateofus/username (str "@" preferred-name))
468+
(gfycat/generate-gfy identity))))
469+
455470
(re-frame/reg-sub
456471
:multiaccount/default-account
457472
:<- [:multiaccount/accounts]

src/status_im/ui/screens/chat/sheets.cljs

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103

104104
(defn group-chat-actions []
105105
(fn [{:keys [chat-id group-chat chat-name color]}]
106-
(let [joined @(re-frame/subscribe [:group-chat/chat-joined? chat-id])]
106+
(let [{:keys [joined?]} @(re-frame/subscribe [:group-chat/inviter-info chat-id])]
107107
[react/view
108108
[list-item/list-item
109109
{:theme :action
@@ -131,7 +131,7 @@
131131
:accessibility-label :fetch-history-button
132132
:icon :main-icons/arrow-down
133133
:on-press #(hide-sheet-and-dispatch [:chat.ui/fetch-history-pressed chat-id])}]
134-
(when joined
134+
(when joined?
135135
[list-item/list-item
136136
{:theme :action
137137
:title :t/leave-chat

src/status_im/ui/screens/ens/views.cljs

+7-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
[status-im.ui.components.radio :as radio]
1919
[status-im.ui.components.react :as react]
2020
[status-im.ui.components.topbar :as topbar]
21+
[status-im.ui.screens.chat.utils :as chat.utils]
2122
[status-im.ui.screens.chat.message.message :as message]
23+
[status-im.ui.screens.chat.styles.message.message :as message.style]
2224
[status-im.ui.screens.chat.photos :as photos]
2325
[status-im.ui.screens.profile.components.views :as profile.components]
2426
[status-im.utils.debounce :as debounce])
@@ -624,6 +626,10 @@
624626
[name-item {:name name :hide-chevron? true :action action}]]
625627
[radio/radio (= name preferred-name)]]]))]]]])
626628

629+
(views/defview my-name []
630+
(views/letsubs [contact-name [:multiaccount/my-name]]
631+
(chat.utils/format-author contact-name message.style/message-author-name-container)))
632+
627633
(defn- registered [names {:keys [preferred-name public-key] :as account} _]
628634
[react/view {:style {:flex 1}}
629635
[react/scroll-view
@@ -663,7 +669,7 @@
663669
:timestamp-str "9:41 AM"}]
664670
[react/view
665671
[react/view {:padding-left 72}
666-
[message/message-author-name public-key]]
672+
[my-name]]
667673
[react/view {:flex-direction :row}
668674
[react/view {:padding-left 16 :padding-right 8 :padding-top 4}
669675
[photos/photo (multiaccounts/displayed-photo account) {:size 36}]]

src/status_im/ui/screens/home/views/inner_item.cljs

+1-7
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,6 @@
101101
:accessibility-label :unviewed-messages-public}]
102102
[badge/message-counter unviewed-messages-count])))
103103

104-
(defview one-to-one-title [from]
105-
(letsubs [contact-name [:contacts/contact-name-by-identity from]]
106-
[react/text-class
107-
{:accessibility-label :chat-name-text}
108-
(utils/truncate-str contact-name 30)]))
109-
110104
(defn home-list-item [[_ home-item]]
111105
(let [{:keys [chat-id chat-name color online group-chat
112106
public? timestamp last-message]}
@@ -122,7 +116,7 @@
122116
:else nil)
123117
:title (if group-chat
124118
(utils/truncate-str chat-name 30)
125-
[one-to-one-title chat-id])
119+
@(re-frame/subscribe [:contacts/contact-name-by-identity chat-id]))
126120
:title-accessibility-label :chat-name-text
127121
:title-row-accessory [message-timestamp (if (pos? (:whisper-timestamp last-message))
128122
(:whisper-timestamp last-message)

0 commit comments

Comments
 (0)