Skip to content

Commit 9aac94d

Browse files
committed
show trust status in chat list
1 parent 71ff67f commit 9aac94d

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

src/status_im/contexts/chat/home/chat_list_item/view.cljs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,9 @@
249249
(rf/sub [:contacts/contact-two-names-by-identity chat-id]))
250250
{:keys [ens-verified added?] :as contact} (when-not group-chat
251251
(rf/sub [:contacts/contact-by-address chat-id]))
252-
unread-messages? (pos? unviewed-messages-count)]
252+
unread-messages? (pos? unviewed-messages-count)
253+
trust-status (rf/sub [:contacts/contact-trust-status chat-id])
254+
untrustworthy? (= constants/contact-trust-status-untrustworthy trust-status)]
253255
[rn/view {:style {:flex-direction :row}}
254256
[avatar-view
255257
{:contact contact
@@ -266,6 +268,7 @@
266268
:verified? ens-verified
267269
:contact? added?
268270
:muted? muted
271+
:untrustworthy? untrustworthy?
269272
:time-str (datetime/to-short-str timestamp)
270273
:style {:flex-shrink 1}}]
271274
[last-message-preview group-chat last-message muted unread-messages?]]]

src/status_im/contexts/contact/trust/events.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
:on-error #(log/error "failed remove contact trust status" % contact-id)}]}))
4646

4747
(rf/reg-event-fx :contact/mark-as-untrusted-sheet
48-
(fn [_ [public-key primary-name] :as item]
48+
(fn [_ {:keys [public-key primary-name] :as item}]
4949
{:dispatch
5050
[:show-bottom-sheet
5151
{:content (fn []

src/status_im/subs/contact.cljs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,3 +302,10 @@
302302
(seq admins) (assoc :owner {:title (i18n/label :t/owner) :data admins})
303303
(seq online) (assoc :online {:title (i18n/label :t/online) :data online})
304304
(seq offline) (assoc :offline {:title (i18n/label :t/offline) :data offline}))))))
305+
306+
(re-frame/reg-sub
307+
:contacts/contact-trust-status
308+
(fn [[_ chat-id]]
309+
[(re-frame/subscribe [:contacts/contact-by-identity chat-id])])
310+
(fn [[contact]]
311+
(get contact :trust-status constants/contact-trust-status-unknown)))

0 commit comments

Comments
 (0)