mirror of
https://github.com/status-im/status-react.git
synced 2025-02-22 15:48:50 +00:00
parent
ac7da93387
commit
c8a3d13ca3
@ -796,11 +796,7 @@ function sendTransaction(params, context) {
|
||||
try {
|
||||
return web3.eth.sendTransaction(data);
|
||||
} catch (err) {
|
||||
var error = status.components.validationMessage(
|
||||
"Error",
|
||||
err.message
|
||||
);
|
||||
return {error: {markup: error}};
|
||||
return {error: err.message};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
|
||||
(handlers/register-handler :request-command-data
|
||||
(handlers/side-effect!
|
||||
(fn [{:keys [chats] :as db}
|
||||
(fn [{:keys [chats current-account-id] :as db}
|
||||
[_ {{:keys [command params content-command type]} :content
|
||||
:keys [message-id chat-id address on-requested] :as message} data-type]]
|
||||
:keys [message-id chat-id on-requested] :as message} data-type]]
|
||||
(if-not (get-in chats [chat-id :commands-loaded])
|
||||
(do (dispatch [:add-commands-loading-callback
|
||||
chat-id
|
||||
@ -24,7 +24,7 @@
|
||||
to (get-in db [:contacts chat-id :address])
|
||||
params {:parameters params
|
||||
:context (merge {:platform platform/platform
|
||||
:from address
|
||||
:from current-account-id
|
||||
:to to}
|
||||
i18n/delimeters)}
|
||||
callback #(let [result (get-in % [:result :returned])
|
||||
|
@ -2,7 +2,8 @@
|
||||
(:require-macros [status-im.utils.views :refer [defview]])
|
||||
(:require [status-im.components.react :as c]
|
||||
[status-im.chat.styles.input.validation-message :as style]
|
||||
[status-im.utils.listview :as lw]))
|
||||
[status-im.utils.listview :as lw]
|
||||
[status-im.i18n :as i18n]))
|
||||
|
||||
(defn validation-message [{:keys [title description]}]
|
||||
[c/view style/message-container
|
||||
@ -18,7 +19,10 @@
|
||||
(defview validation-messages-view []
|
||||
[chat-input-margin [:chat-input-margin]
|
||||
input-height [:chat-ui-props :input-height]
|
||||
markup [:chat-ui-props :validation-messages]]
|
||||
(when markup
|
||||
messages [:chat-ui-props :validation-messages]]
|
||||
(when messages
|
||||
[c/view (style/root (+ input-height chat-input-margin))
|
||||
[messages-list markup]]))
|
||||
(if (string? messages)
|
||||
[messages-list [validation-message {:title (i18n/label :t/error)
|
||||
:description messages}]]
|
||||
[messages-list messages])]))
|
||||
|
@ -75,7 +75,7 @@
|
||||
(defn restart-rpc []
|
||||
(when-not @restarting-rpc
|
||||
(reset! restarting-rpc true)
|
||||
(log/debug :restrt-rpc-on-post-error)
|
||||
(log/debug :restart-rpc-on-post-error)
|
||||
|
||||
;; todo maybe it would be better to use something like
|
||||
;; restart-rpc-server on status-go side
|
||||
|
@ -194,7 +194,7 @@
|
||||
|
||||
(register-handler :transaction-failed
|
||||
(u/side-effect!
|
||||
(fn [_ [_ {:keys [id message_id error_code]}]]
|
||||
(fn [_ [_ {:keys [id message_id error_code error_message] :as event}]]
|
||||
(cond
|
||||
|
||||
(= error_code wrong-password-code)
|
||||
@ -204,9 +204,11 @@
|
||||
(do (when message_id
|
||||
(dispatch [::remove-pending-message message_id]))
|
||||
(dispatch [:clear-selected-transaction])
|
||||
(dispatch [::remove-transaction id]))
|
||||
(dispatch [::remove-transaction id])
|
||||
(dispatch [:set-chat-ui-props :validation-messages error_message]))
|
||||
|
||||
:else nil))))
|
||||
:else
|
||||
(dispatch [:set-chat-ui-props :validation-messages nil])))))
|
||||
|
||||
(register-handler :clear-selected-transaction
|
||||
(fn [db _]
|
||||
|
@ -13,6 +13,7 @@
|
||||
:next "Next"
|
||||
:type-a-message "Type a message..."
|
||||
:type-a-command "Start typing a command..."
|
||||
:error "Error"
|
||||
|
||||
;drawer
|
||||
:invite-friends "Invite friends"
|
||||
|
Loading…
x
Reference in New Issue
Block a user