handle hash-message failure correctly
Signed-off-by: Michele Balistreri <michele@bitgamma.com>
This commit is contained in:
parent
114e704b78
commit
213c288cc1
|
@ -3,6 +3,7 @@
|
||||||
[status-im.ethereum.abi-spec :as abi-spec]
|
[status-im.ethereum.abi-spec :as abi-spec]
|
||||||
[status-im.native-module.core :as status]
|
[status-im.native-module.core :as status]
|
||||||
[status-im.utils.fx :as fx]
|
[status-im.utils.fx :as fx]
|
||||||
|
[status-im.i18n.i18n :as i18n]
|
||||||
[status-im.utils.types :as types]
|
[status-im.utils.types :as types]
|
||||||
[taoensso.timbre :as log]))
|
[taoensso.timbre :as log]))
|
||||||
|
|
||||||
|
@ -62,10 +63,14 @@
|
||||||
{:events [:signing.keycard.callback/hash-message-completed]}
|
{:events [:signing.keycard.callback/hash-message-completed]}
|
||||||
[{:keys [db]} data typed? result]
|
[{:keys [db]} data typed? result]
|
||||||
(let [{:keys [result error]} (types/json->clj result)]
|
(let [{:keys [result error]} (types/json->clj result)]
|
||||||
{:db (update db :keycard assoc
|
(if error
|
||||||
:hash result
|
{:dispatch [:signing.ui/cancel-is-pressed]
|
||||||
:typed? typed?
|
:utils/show-popup {:title (i18n/label :t/sign-request-failed)
|
||||||
:data data)}))
|
:content (:message error)}}
|
||||||
|
{:db (update db :keycard assoc
|
||||||
|
:hash result
|
||||||
|
:typed? typed?
|
||||||
|
:data data)})))
|
||||||
|
|
||||||
(fx/defn hash-transaction
|
(fx/defn hash-transaction
|
||||||
[{:keys [db]}]
|
[{:keys [db]}]
|
||||||
|
|
Loading…
Reference in New Issue