Skip to content

Commit 7cd9f76

Browse files
authored
Fix UI freezing when image is opened from activity center (#16707)
1 parent 238e35a commit 7cd9f76

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

src/quo2/components/notifications/activity_log/style.cljs

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@
2525
(def message-body
2626
{:color colors/white})
2727

28-
(def message-container
28+
(defn message-container
29+
[attachment]
2930
{:border-radius 12
3031
:margin-top 12
3132
:padding-horizontal 12
32-
:padding-vertical 8
33+
:padding-vertical (if (#{:photo :gif} attachment) 12 8)
3334
:background-color colors/white-opa-5})
3435

3536
(def footer-container

src/quo2/components/notifications/activity_log/view.cljs

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
context))))
7575

7676
(defn- activity-message
77-
[{:keys [title body title-number-of-lines body-number-of-lines]}]
78-
[rn/view {:style style/message-container}
77+
[{:keys [title body title-number-of-lines body-number-of-lines attachment]}]
78+
[rn/view {:style (style/message-container attachment)}
7979
(when title
8080
[text/text
8181
{:size :paragraph-2

src/status_im2/contexts/shell/activity_center/notification/reply/view.cljs

+21-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[utils.datetime :as datetime]
1111
[utils.i18n :as i18n]
1212
[utils.re-frame :as rf]
13-
[status-im2.contexts.chat.messages.content.image.view :as image]))
13+
[status-im.utils.http :as http]))
1414

1515
;; NOTE: Replies support text, image and stickers only.
1616
(defn- get-message-content
@@ -19,7 +19,11 @@
1919
constants/content-type-text [quo/text {:style style/tag-text}
2020
(get-in message [:content :text])]
2121

22-
constants/content-type-image [image/image-message 0 message nil]
22+
constants/content-type-image
23+
(let [image (get-in message [:content :image])
24+
image-local-url (http/replace-port image (rf/sub [:mediaserver/port]))
25+
photos (when image-local-url [{:uri image-local-url}])]
26+
[quo/activity-logs-photos {:photos photos}])
2327

2428
constants/content-type-sticker [old-message/sticker message]
2529

@@ -72,4 +76,19 @@
7276
[quo/context-tag common/tag-params community-image community-name chat-name]
7377
[quo/group-avatar-tag chat-name common/tag-params])]
7478
:message {:body-number-of-lines 1
79+
:attachment (cond
80+
(= (:content-type message) constants/content-type-text)
81+
:text
82+
83+
(= (:content-type message) constants/content-type-image)
84+
:photo
85+
86+
(= (:content-type message) constants/content-type-sticker)
87+
:sticker
88+
89+
(= (:content-type message) constants/content-type-gif)
90+
:gif
91+
92+
:else
93+
nil)
7594
:body (get-message-content message)}}]]]))

0 commit comments

Comments
 (0)