mirror of
https://github.com/status-im/status-react.git
synced 2025-02-26 09:35:36 +00:00
[Fix] Navigation to message reaction (#16218)
Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
This commit is contained in:
parent
032c254d19
commit
c59de7dbf8
@ -104,7 +104,6 @@
|
|||||||
:emoji-id emoji-id
|
:emoji-id emoji-id
|
||||||
:from from})
|
:from from})
|
||||||
|
|
||||||
|
|
||||||
(defn- format-response
|
(defn- format-response
|
||||||
[response]
|
[response]
|
||||||
(->> (transforms/js->clj response)
|
(->> (transforms/js->clj response)
|
||||||
@ -113,24 +112,22 @@
|
|||||||
|
|
||||||
(rf/defn save-emoji-reaction-details
|
(rf/defn save-emoji-reaction-details
|
||||||
{:events [:chat/save-emoji-reaction-details]}
|
{:events [:chat/save-emoji-reaction-details]}
|
||||||
[{:keys [db]} message-reactions long-pressed-emoji]
|
[{:keys [db]} reaction-authors]
|
||||||
{:db (assoc db
|
{:db (assoc db :chat/reactions-authors reaction-authors)})
|
||||||
:chat/reactions-authors
|
|
||||||
{:reaction-authors-list message-reactions
|
|
||||||
:selected-reaction long-pressed-emoji})})
|
|
||||||
|
|
||||||
(rf/defn clear-emoji-reaction-details
|
(rf/defn clear-emoji-reaction-details
|
||||||
{:events [:chat/clear-emoji-reaction-author-details]}
|
{:events [:chat/clear-emoji-reaction-author-details]}
|
||||||
[{:keys [db]} message-reactions]
|
[{:keys [db]}]
|
||||||
{:db (update db dissoc :chat/reactions-authors)})
|
{:db (dissoc db :chat/reactions-authors)})
|
||||||
|
|
||||||
(rf/defn emoji-reactions-by-message-id
|
(rf/defn emoji-reactions-by-message-id
|
||||||
{:events [:chat.ui/emoji-reactions-by-message-id]}
|
{:events [:chat.ui/emoji-reactions-by-message-id]}
|
||||||
[{:keys [db]} {:keys [message-id long-pressed-emoji]}]
|
[{:keys [db]} {:keys [message-id on-success]}]
|
||||||
{:json-rpc/call [{:method "wakuext_emojiReactionsByChatIDMessageID"
|
{:db (dissoc db :chat/reactions-authors)
|
||||||
|
:json-rpc/call [{:method "wakuext_emojiReactionsByChatIDMessageID"
|
||||||
:params [(:current-chat-id db) message-id]
|
:params [(:current-chat-id db) message-id]
|
||||||
:js-response true
|
:js-response true
|
||||||
:on-error #(log/error "failed to fetch emoji reaction by message-id: "
|
:on-error #(log/error "failed to fetch emoji reaction by message-id: "
|
||||||
{:message-id message-id :error %})
|
{:message-id message-id :error %})
|
||||||
:on-success #(rf/dispatch [:chat/save-emoji-reaction-details
|
:on-success #(when on-success
|
||||||
(format-response %) long-pressed-emoji])}]})
|
(on-success (format-response %)))}]})
|
||||||
|
@ -17,25 +17,23 @@
|
|||||||
:emoji-id emoji-id}])))
|
:emoji-id emoji-id}])))
|
||||||
|
|
||||||
(defn- on-long-press
|
(defn- on-long-press
|
||||||
[message-id emoji-id]
|
[message-id emoji-id user-message-content reactions]
|
||||||
(rf/dispatch [:chat.ui/emoji-reactions-by-message-id
|
(rf/dispatch [:chat.ui/emoji-reactions-by-message-id
|
||||||
{:message-id message-id
|
{:message-id message-id
|
||||||
:long-pressed-emoji emoji-id}]))
|
:on-success (fn [response]
|
||||||
|
(rf/dispatch [:chat/save-emoji-reaction-details
|
||||||
(defn show-authors-sheet
|
{:reaction-authors-list response
|
||||||
[user-message-content reactions]
|
:selected-reaction emoji-id}])
|
||||||
(rf/dispatch [:dismiss-keyboard])
|
(rf/dispatch [:dismiss-keyboard])
|
||||||
(rf/dispatch
|
(rf/dispatch [:show-bottom-sheet
|
||||||
[:show-bottom-sheet
|
{:on-close (fn []
|
||||||
{:on-close (fn []
|
(rf/dispatch
|
||||||
(rf/dispatch
|
[:chat/clear-emoji-reaction-author-details]))
|
||||||
[:chat/clear-emoji-reaction-author-details]))
|
:content (fn []
|
||||||
:content (fn []
|
[drawers/reaction-authors reactions])
|
||||||
[drawers/reaction-authors
|
:selected-item (fn []
|
||||||
(map :emoji-id reactions)])
|
user-message-content)
|
||||||
:selected-item (fn []
|
:padding-bottom-override 0}]))}]))
|
||||||
user-message-content)
|
|
||||||
:padding-bottom-override 0}]))
|
|
||||||
|
|
||||||
(defn message-reactions-row
|
(defn message-reactions-row
|
||||||
[{:keys [message-id chat-id]} user-message-content]
|
[{:keys [message-id chat-id]} user-message-content]
|
||||||
@ -55,11 +53,10 @@
|
|||||||
:neutral? own
|
:neutral? own
|
||||||
:clicks quantity
|
:clicks quantity
|
||||||
:on-press #(on-press own message-id emoji-id emoji-reaction-id)
|
:on-press #(on-press own message-id emoji-id emoji-reaction-id)
|
||||||
:on-long-press (fn []
|
:on-long-press #(on-long-press message-id
|
||||||
(on-long-press message-id
|
emoji-id
|
||||||
emoji-id)
|
user-message-content
|
||||||
(show-authors-sheet user-message-content
|
(map :emoji-id reactions))
|
||||||
reactions))
|
|
||||||
:accessibility-label (str "emoji-reaction-" emoji-id)}]])
|
:accessibility-label (str "emoji-reaction-" emoji-id)}]])
|
||||||
[quo/add-reaction
|
[quo/add-reaction
|
||||||
{:on-press (fn []
|
{:on-press (fn []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user