mirror of
https://github.com/status-im/status-mobile.git
synced 2025-02-10 07:36:46 +00:00
refactor callback
This commit is contained in:
parent
ddefb9c0a0
commit
711bca5451
@ -8,6 +8,7 @@
|
|||||||
[status-im.contexts.profile.config :as profile.config]
|
[status-im.contexts.profile.config :as profile.config]
|
||||||
[status-im.contexts.syncing.utils :as sync-utils]
|
[status-im.contexts.syncing.utils :as sync-utils]
|
||||||
[taoensso.timbre :as log]
|
[taoensso.timbre :as log]
|
||||||
|
[oops.core :as oops]
|
||||||
[utils.i18n :as i18n]
|
[utils.i18n :as i18n]
|
||||||
[utils.re-frame :as rf]
|
[utils.re-frame :as rf]
|
||||||
[utils.security.core :as security]
|
[utils.security.core :as security]
|
||||||
@ -88,10 +89,8 @@
|
|||||||
{:response raw-response
|
{:response raw-response
|
||||||
:event :syncing/preflight-outbound-check})
|
:event :syncing/preflight-outbound-check})
|
||||||
(def --x raw-response)
|
(def --x raw-response)
|
||||||
(let [^js response-js (transforms/json->js raw-response)
|
(let [error? (-> raw-response transforms/json->js (oops/oget :error) seq)]
|
||||||
error (transforms/js->clj (.-error response-js))]
|
(if error?
|
||||||
(prn "-------------------" error)
|
|
||||||
(if (not (empty? error)) ;; TODO: check the received value
|
|
||||||
(rf/dispatch [:toasts/upsert
|
(rf/dispatch [:toasts/upsert
|
||||||
{:type :negative
|
{:type :negative
|
||||||
:theme :dark
|
:theme :dark
|
||||||
|
Loading…
x
Reference in New Issue
Block a user