refactor callback

This commit is contained in:
Ulises M 2025-01-28 18:30:31 -06:00
parent ddefb9c0a0
commit 711bca5451

View File

@ -8,6 +8,7 @@
[status-im.contexts.profile.config :as profile.config]
[status-im.contexts.syncing.utils :as sync-utils]
[taoensso.timbre :as log]
[oops.core :as oops]
[utils.i18n :as i18n]
[utils.re-frame :as rf]
[utils.security.core :as security]
@ -88,10 +89,8 @@
{:response raw-response
:event :syncing/preflight-outbound-check})
(def --x raw-response)
(let [^js response-js (transforms/json->js raw-response)
error (transforms/js->clj (.-error response-js))]
(prn "-------------------" error)
(if (not (empty? error)) ;; TODO: check the received value
(let [error? (-> raw-response transforms/json->js (oops/oget :error) seq)]
(if error?
(rf/dispatch [:toasts/upsert
{:type :negative
:theme :dark