mirror of
https://github.com/status-im/status-react.git
synced 2025-02-02 14:14:39 +00:00
parent
065a0ddc80
commit
374264e108
@ -1832,11 +1832,13 @@ status.response({
|
|||||||
params: [{
|
params: [{
|
||||||
name: "password",
|
name: "password",
|
||||||
type: status.types.PASSWORD,
|
type: status.types.PASSWORD,
|
||||||
placeholder: I18n.t('password_placeholder')
|
placeholder: I18n.t('password_placeholder'),
|
||||||
|
hidden: true
|
||||||
}, {
|
}, {
|
||||||
name: "password-confirmation",
|
name: "password-confirmation",
|
||||||
type: status.types.PASSWORD,
|
type: status.types.PASSWORD,
|
||||||
placeholder: I18n.t('password_placeholder2')
|
placeholder: I18n.t('password_placeholder2'),
|
||||||
|
hidden: true
|
||||||
}],
|
}],
|
||||||
validator: function (params, context) {
|
validator: function (params, context) {
|
||||||
var errorMessages = [];
|
var errorMessages = [];
|
||||||
|
@ -99,12 +99,15 @@
|
|||||||
[_ add-to-chat-id {:keys [chat-id command-message command handler-data] :as params}]]
|
[_ add-to-chat-id {:keys [chat-id command-message command handler-data] :as params}]]
|
||||||
(let [clock-value (messages/get-last-clock-value chat-id)
|
(let [clock-value (messages/get-last-clock-value chat-id)
|
||||||
request (:request (:handler-data command))
|
request (:request (:handler-data command))
|
||||||
|
hidden-params (->> (:params (:command command))
|
||||||
|
(filter #(= (:hidden %) true))
|
||||||
|
(map #(:name %)))
|
||||||
command' (->> (assoc command-message :handler-data handler-data)
|
command' (->> (assoc command-message :handler-data handler-data)
|
||||||
(prepare-command current-public-key chat-id clock-value request)
|
(prepare-command current-public-key chat-id clock-value request)
|
||||||
(cu/check-author-direction db chat-id))]
|
(cu/check-author-direction db chat-id))]
|
||||||
(log/debug "Handler data: " request handler-data (dissoc params :commands :command-message))
|
(log/debug "Handler data: " request handler-data (dissoc params :commands :command-message))
|
||||||
(dispatch [:update-message-overhead! chat-id network-status])
|
(dispatch [:update-message-overhead! chat-id network-status])
|
||||||
(dispatch [::send-command! add-to-chat-id (assoc params :command command')])
|
(dispatch [::send-command! add-to-chat-id (assoc params :command command') hidden-params])
|
||||||
(when (cu/console? chat-id)
|
(when (cu/console? chat-id)
|
||||||
(dispatch `[:console-respond-command params]))
|
(dispatch `[:console-respond-command params]))
|
||||||
(when (and (= "send" (get-in command-message [:command :name]))
|
(when (and (= "send" (get-in command-message [:command :name]))
|
||||||
@ -119,9 +122,9 @@
|
|||||||
|
|
||||||
(register-handler ::send-command!
|
(register-handler ::send-command!
|
||||||
(u/side-effect!
|
(u/side-effect!
|
||||||
(fn [_ [_ add-to-chat-id params]]
|
(fn [_ [_ add-to-chat-id params hidden-params]]
|
||||||
(dispatch [::add-command add-to-chat-id params])
|
(dispatch [::add-command add-to-chat-id params])
|
||||||
(dispatch [::save-command! add-to-chat-id params])
|
(dispatch [::save-command! add-to-chat-id params hidden-params])
|
||||||
(when (not= add-to-chat-id wallet-chat-id)
|
(when (not= add-to-chat-id wallet-chat-id)
|
||||||
(dispatch [::dispatch-responded-requests! params])
|
(dispatch [::dispatch-responded-requests! params])
|
||||||
(dispatch [::send-command-protocol! params])))))
|
(dispatch [::send-command-protocol! params])))))
|
||||||
@ -134,10 +137,11 @@
|
|||||||
|
|
||||||
(register-handler ::save-command!
|
(register-handler ::save-command!
|
||||||
(u/side-effect!
|
(u/side-effect!
|
||||||
(fn [_ [_ chat-id {:keys [command]}]]
|
(fn [_ [_ chat-id {:keys [command]} hidden-params]]
|
||||||
(messages/save
|
(let [command (-> command
|
||||||
chat-id
|
(update-in [:content :params] #(apply dissoc % hidden-params))
|
||||||
(dissoc command :rendered-preview :to-message :has-handler)))))
|
(dissoc :rendered-preview :to-message :has-handler))]
|
||||||
|
(messages/save chat-id command)))))
|
||||||
|
|
||||||
(register-handler ::dispatch-responded-requests!
|
(register-handler ::dispatch-responded-requests!
|
||||||
(u/side-effect!
|
(u/side-effect!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user