From 965dce053db358506a9dd87a01fc3ad80ace1c5a Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Fri, 14 Feb 2020 13:18:42 +0200 Subject: [PATCH] [#10041] Request token price after adding --- src/status_im/utils/prices.cljs | 12 +++++++++--- src/status_im/wallet/custom_tokens/core.cljs | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/status_im/utils/prices.cljs b/src/status_im/utils/prices.cljs index 480cfcb0f2..691ce685c3 100644 --- a/src/status_im/utils/prices.cljs +++ b/src/status_im/utils/prices.cljs @@ -1,7 +1,8 @@ (ns status-im.utils.prices - (:require [status-im.utils.http :as http] + (:require [clojure.string :as string] + [status-im.utils.http :as http] [status-im.utils.types :as types] - [status-im.utils.config :as config])) + [taoensso.timbre :as log])) ;; Responsible for interacting with Cryptocompare API to get current prices for ;; currencies and tokens. @@ -15,7 +16,7 @@ (def status-identifier "extraParams=Status.im") (defn- ->url-param-syms [syms] - ((comp (partial clojure.string/join ",") (partial map name)) syms)) + ((comp (partial string/join ",") (partial map name)) syms)) (defn- gen-price-url [fsyms tsyms chaos-mode?] (if chaos-mode? @@ -40,6 +41,11 @@ :last-day (:OPEN24HOUR entry)}}))})))) (defn get-prices [from to mainnet? on-success on-error chaos-mode?] + (log/debug "[prices] get-prices" + "from" from + "to" to + "mainnet?" mainnet? + "chaos-mode?" chaos-mode?) (http/get (gen-price-url from to chaos-mode?) (fn [resp] (on-success (format-price-resp resp mainnet?))) diff --git a/src/status_im/wallet/custom_tokens/core.cljs b/src/status_im/wallet/custom_tokens/core.cljs index 9f72ef1486..77e76cc4f7 100644 --- a/src/status_im/wallet/custom_tokens/core.cljs +++ b/src/status_im/wallet/custom_tokens/core.cljs @@ -183,6 +183,7 @@ :params [new-token] :on-success #()}]} (wallet/add-custom-token new-token) + (wallet/update-prices) (navigation/navigate-back)))) (fx/defn remove-custom-token