http kudos token image
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
parent
7d0c655441
commit
e2533e9964
|
@ -6,7 +6,8 @@
|
||||||
[re-frame.core :as re-frame]
|
[re-frame.core :as re-frame]
|
||||||
[status-im.utils.handlers :as handlers]
|
[status-im.utils.handlers :as handlers]
|
||||||
[status-im.constants :as constants]
|
[status-im.constants :as constants]
|
||||||
[status-im.utils.ethereum.core :as ethereum]))
|
[status-im.utils.ethereum.core :as ethereum]
|
||||||
|
[clojure.string :as string]))
|
||||||
|
|
||||||
(def kudos :KDO)
|
(def kudos :KDO)
|
||||||
|
|
||||||
|
@ -23,14 +24,20 @@
|
||||||
#(re-frame/dispatch [:token-uri-success
|
#(re-frame/dispatch [:token-uri-success
|
||||||
tokenId
|
tokenId
|
||||||
(when %2
|
(when %2
|
||||||
;;TODO extra chars in rinkeby
|
(subs %2 (.indexOf %2 "http")))]))))) ;; extra chars in rinkeby
|
||||||
(subs %2 (.indexOf %2 "http")))])))))
|
|
||||||
|
|
||||||
(handlers/register-handler-fx
|
(handlers/register-handler-fx
|
||||||
:token-uri-success
|
:token-uri-success
|
||||||
(fn [_ [_ tokenId token-uri]]
|
(fn [_ [_ tokenId token-uri]]
|
||||||
{:http-get {:url token-uri
|
{:http-get {:url
|
||||||
:success-event-creator (fn [o]
|
token-uri
|
||||||
[:load-collectible-success kudos {tokenId (http/parse-payload o)}])
|
:success-event-creator
|
||||||
:failure-event-creator (fn [o]
|
(fn [o]
|
||||||
[:load-collectible-failure kudos {tokenId (http/parse-payload o)}])}}))
|
[:load-collectible-success kudos {tokenId (update (http/parse-payload o)
|
||||||
|
:image
|
||||||
|
string/replace
|
||||||
|
#"http:"
|
||||||
|
"https:")}]) ;; http in mainnet
|
||||||
|
:failure-event-creator
|
||||||
|
(fn [o]
|
||||||
|
[:load-collectible-failure kudos {tokenId (http/parse-payload o)}])}}))
|
||||||
|
|
Loading…
Reference in New Issue