Skip to content

Commit ee71117

Browse files
authored
remove unused code relate to old text-input component (#15765)
* remove unused code relate to old text-input component * removed tow lines
1 parent 3e9d5dd commit ee71117

File tree

11 files changed

+28
-1105
lines changed

11 files changed

+28
-1105
lines changed

src/status_im/chat/models/input.cljs

+15-18
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
[utils.re-frame :as rf]
1111
[utils.i18n :as i18n]
1212
[status-im.utils.utils :as utils]
13-
[taoensso.timbre :as log]
14-
[status-im.ui.screens.chat.components.input :as input]))
13+
[taoensso.timbre :as log]))
1514

1615
(defn text->emoji
1716
"Replaces emojis in a specified `text`"
@@ -92,15 +91,14 @@
9291
[{:keys [db] :as cofx} message]
9392
(let [current-chat-id (:current-chat-id db)
9493
text (get-in message [:content :text])]
95-
(rf/merge cofx
96-
{:db (-> db
97-
(assoc-in [:chat/inputs current-chat-id :metadata :editing-message]
98-
message)
99-
(assoc-in [:chat/inputs current-chat-id :metadata :responding-to-message] nil)
100-
(update-in [:chat/inputs current-chat-id :metadata]
101-
dissoc
102-
:sending-image))}
103-
(input/set-input-text text current-chat-id))))
94+
{:db (-> db
95+
(assoc-in [:chat/inputs current-chat-id :metadata :editing-message]
96+
message)
97+
(assoc-in [:chat/inputs current-chat-id :metadata :responding-to-message] nil)
98+
(update-in [:chat/inputs current-chat-id :metadata]
99+
dissoc
100+
:sending-image))
101+
:dispatch [:mention/to-input-field text current-chat-id]}))
104102

105103
(rf/defn show-contact-request-input
106104
"Sets reference to previous chat message and focuses on input"
@@ -270,13 +268,12 @@
270268
{:events [:contacts/send-contact-request]}
271269
[{:keys [db] :as cofx} public-key message]
272270
(rf/merge cofx
273-
{:chat.ui/clear-inputs nil
274-
:chat.ui/clear-inputs-old nil
275-
:json-rpc/call [{:method "wakuext_sendContactRequest"
276-
:js-response true
277-
:params [{:id public-key :message message}]
278-
:on-error #(log/warn "failed to send a contact request" %)
279-
:on-success #(re-frame/dispatch [:transport/message-sent %])}]}
271+
{:chat.ui/clear-inputs nil
272+
:json-rpc/call [{:method "wakuext_sendContactRequest"
273+
:js-response true
274+
:params [{:id public-key :message message}]
275+
:on-error #(log/warn "failed to send a contact request" %)
276+
:on-success #(re-frame/dispatch [:transport/message-sent %])}]}
280277
(mentions/clear-mentions)
281278
(clean-input (:current-chat-id db))))
282279

src/status_im/chat/models/mentions.cljs

+13
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,19 @@
8080
(log/error "[mentions] on-error"
8181
{:context context
8282
:error error}))
83+
84+
(rf/defn to-input-field
85+
{:events [:mention/to-input-field]}
86+
[_ text chat-id]
87+
(let [params [chat-id text]
88+
method "wakuext_chatMentionToInputField"]
89+
(log/debug "[mentions] to-input-field" {:params params})
90+
{:json-rpc/call [{:method method
91+
:params params
92+
:on-success #(rf/dispatch [:mention/on-to-input-field-success %])
93+
:on-error #(rf/dispatch [:mention/on-error
94+
{:method method
95+
:params params} %])}]}))
8396
(rf/defn on-to-input-field-success
8497
{:events [:mention/on-to-input-field-success]}
8598
[{:keys [db]} result]

src/status_im/multiaccounts/logout/core.cljs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
(rf/merge cofx
1717
{:set-root :progress
1818
:chat.ui/clear-inputs nil
19-
:chat.ui/clear-inputs-old nil
2019
:shell/reset-bottom-tabs nil
2120
:hide-popover nil
2221
::logout nil

src/status_im/ui/screens/chat/components/accessory.cljs

-157
This file was deleted.

src/status_im/ui/screens/chat/components/contact_request.cljs

-98
This file was deleted.

src/status_im/ui/screens/chat/components/edit.cljs

-59
This file was deleted.

0 commit comments

Comments
 (0)