fix no icon for ETH in 1-1 transaction messages (#13898)

This commit is contained in:
Parvesh Monu 2022-08-31 20:49:33 +05:30 committed by GitHub
parent 04b69181f2
commit 698e548c6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 12 deletions

View File

@ -24,19 +24,10 @@
(defn network->icon [network] (defn network->icon [network]
(let [s (str "./resources/images/tokens/" (name network) "/0-native.png") (let [s (str "./resources/images/tokens/" (name network) "/0-native.png")
s-js (str "." s) s-js (str "." s)]
image (gensym)]
(if (.exists (io/file s)) (if (.exists (io/file s))
`(let [~image (atom nil)] `(js/require ~s-js)
(fn [] `(js/require "../resources/images/tokens/default-token.png"))))
(or @~image
(reset! ~image (js/require ~s-js)))))
`(let [~image (atom nil)]
(fn []
(or
@~image
(reset! ~image
(js/require "../resources/images/tokens/default-token.png"))))))))
(defmacro resolve-native-currency-icons (defmacro resolve-native-currency-icons
"In react-native arguments to require must be static strings. "In react-native arguments to require must be static strings.