From 711bca5451b0a723adcc464d5eb4eb943e4b431c Mon Sep 17 00:00:00 2001 From: Ulises M Date: Tue, 28 Jan 2025 18:30:31 -0600 Subject: [PATCH] refactor callback --- src/status_im/contexts/syncing/events.cljs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/status_im/contexts/syncing/events.cljs b/src/status_im/contexts/syncing/events.cljs index 6fb9db6cdc..b18bf6956e 100644 --- a/src/status_im/contexts/syncing/events.cljs +++ b/src/status_im/contexts/syncing/events.cljs @@ -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