[19576] Fix group avatar not showing group picture (#19723)
This commit is contained in:
parent
1f967c6aa1
commit
8353c65602
|
@ -234,7 +234,9 @@
|
|||
online? (rf/sub [:visibility-status-updates/online? chat-id])
|
||||
contact (when-not group-chat
|
||||
(rf/sub [:contacts/contact-by-address chat-id]))
|
||||
photo-path (rf/sub [:chats/photo-path chat-id])
|
||||
photo-path (if group-chat
|
||||
(rf/sub [:chats/group-chat-image chat-id])
|
||||
(rf/sub [:chats/photo-path chat-id]))
|
||||
top-margin (+ (safe-area/get-top)
|
||||
messages.constants/top-bar-height
|
||||
messages.constants/header-container-top-margin
|
||||
|
|
|
@ -34,7 +34,9 @@
|
|||
(str "# " chat-name)
|
||||
:else (str emoji chat-name))
|
||||
online? (when-not group-chat (rf/sub [:visibility-status-updates/online? chat-id]))
|
||||
photo-path (when-not group-chat (rf/sub [:chats/photo-path chat-id]))
|
||||
photo-path (if group-chat
|
||||
(rf/sub [:chats/group-chat-image chat-id])
|
||||
(rf/sub [:chats/photo-path chat-id]))
|
||||
header-opacity (worklets/navigation-header-opacity
|
||||
distance-from-list-top
|
||||
all-loaded?
|
||||
|
|
|
@ -367,3 +367,10 @@
|
|||
:camera-roll/total-photos-count-ios
|
||||
(fn [{:keys [camera-roll/ios-images-count]}]
|
||||
ios-images-count))
|
||||
|
||||
(re-frame/reg-sub
|
||||
:chats/group-chat-image
|
||||
(fn [[_ chat-id]]
|
||||
(re-frame/subscribe [:chats/chat chat-id]))
|
||||
:->
|
||||
:image)
|
||||
|
|
|
@ -177,3 +177,18 @@
|
|||
(is (= :army (:color result)))
|
||||
(is (= "test" (:chat-name result)))
|
||||
(is (= "🍑" (:emoji result)))))))
|
||||
|
||||
(h/deftest-sub :chats/group-chat-image
|
||||
[sub-name]
|
||||
(testing "returns picture for group"
|
||||
(let [image-data {:uri "data:image/png1234"}
|
||||
chats {chat-id (assoc community-chat
|
||||
:color :army
|
||||
:emoji "🍑"
|
||||
:chat-name "test"
|
||||
:image image-data)}]
|
||||
(swap! rf-db/app-db assoc
|
||||
:chats
|
||||
chats)
|
||||
(let [result (rf/sub [sub-name chat-id])]
|
||||
(= image-data result)))))
|
||||
|
|
Loading…
Reference in New Issue