Get community-id from notification data for mentions and replies (#15100)
* [Chore] Get community-id from notification data * [Chore] Updated name for community chat
This commit is contained in:
parent
5cea66647e
commit
488db615c0
|
@ -36,10 +36,8 @@
|
|||
parsed-text-children))))
|
||||
|
||||
(defn view
|
||||
[{:keys [author chat-name chat-id message read timestamp]}]
|
||||
(let [chat (rf/sub [:chats/chat chat-id])
|
||||
community-id (:community-id chat)
|
||||
is-chat-from-community? (not (nil? community-id))
|
||||
[{:keys [author chat-name community-id chat-id message read timestamp]}]
|
||||
(let [community-chat? (not (string/blank? community-id))
|
||||
community (rf/sub [:communities/community community-id])
|
||||
community-name (:name community)
|
||||
community-image (get-in community [:images :thumbnail :uri])]
|
||||
|
@ -54,7 +52,7 @@
|
|||
:unread? (not read)
|
||||
:context [[common/user-avatar-tag author]
|
||||
[quo/text {:style style/tag-text} (string/lower-case (i18n/label :t/on))]
|
||||
(if is-chat-from-community?
|
||||
(if community-chat?
|
||||
[quo/context-tag tag-params {:uri community-image} community-name chat-name]
|
||||
[quo/group-avatar-tag chat-name tag-params])]
|
||||
:message {:body (message-body message)}}]]))
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
(ns status-im2.contexts.activity-center.notification.reply.view
|
||||
(:require [quo2.core :as quo]
|
||||
(:require [clojure.string :as string]
|
||||
[quo2.core :as quo]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[status-im.ui2.screens.chat.messages.message :as old-message]
|
||||
|
@ -37,10 +38,8 @@
|
|||
nil))
|
||||
|
||||
(defn view
|
||||
[{:keys [author chat-name chat-id message read timestamp]}]
|
||||
(let [chat (rf/sub [:chats/chat chat-id])
|
||||
community-id (:community-id chat)
|
||||
is-chat-from-community? (not (nil? community-id))
|
||||
[{:keys [author chat-name community-id chat-id message read timestamp]}]
|
||||
(let [community-chat? (not (string/blank? community-id))
|
||||
community (rf/sub [:communities/community community-id])
|
||||
community-name (:name community)
|
||||
community-image (get-in community [:images :thumbnail :uri])]
|
||||
|
@ -55,7 +54,7 @@
|
|||
:unread? (not read)
|
||||
:context [[common/user-avatar-tag author]
|
||||
[quo/text {:style style/lowercase-text} (i18n/label :t/on)]
|
||||
(if is-chat-from-community?
|
||||
(if community-chat?
|
||||
[quo/context-tag tag-params {:uri community-image} community-name chat-name]
|
||||
[quo/group-avatar-tag chat-name tag-params])]
|
||||
:message {:body-number-of-lines 1
|
||||
|
|
Loading…
Reference in New Issue