fixed provider
This commit is contained in:
parent
24aba00f23
commit
42bc5f368b
|
@ -27,7 +27,7 @@
|
||||||
[tab-button "ETH" :eth tab-view]
|
[tab-button "ETH" :eth tab-view]
|
||||||
[tab-button "Version" :version tab-view]
|
[tab-button "Version" :version tab-view]
|
||||||
[tab-button "Status API" :api tab-view]
|
[tab-button "Status API" :api tab-view]
|
||||||
(when js/ethereumBeta
|
(when (exists? js/ethereumBeta)
|
||||||
[tab-button "Beta Provider" :beta tab-view])
|
[tab-button "Beta Provider" :beta tab-view])
|
||||||
[tab-button "About" :about tab-view]]
|
[tab-button "About" :about tab-view]]
|
||||||
[react/view {:style {:height 1 :margin-top 10 :background-color "#4360df33"}}]])
|
[react/view {:style {:height 1 :margin-top 10 :background-color "#4360df33"}}]])
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
(:require [re-frame.core :as re-frame]))
|
(:require [re-frame.core :as re-frame]))
|
||||||
|
|
||||||
(def web3 (or (when (exists? js/web3) js/web3)
|
(def web3 (or (when (exists? js/web3) js/web3)
|
||||||
(when js/ethereumBeta
|
(when (exists? js/ethereumBeta)
|
||||||
(js/setTimeout (fn []
|
(js/setTimeout (fn []
|
||||||
(.then (.send js/ethereumBeta "eth_requestAccounts") #(re-frame/dispatch [:set-default-account]))
|
(.then (.send js/ethereumBeta "eth_requestAccounts") #(re-frame/dispatch [:set-default-account]))
|
||||||
(when js/ethereumBeta
|
(when js/ethereumBeta
|
||||||
(.then (.getContactCode js/ethereumBeta.status) #(re-frame/dispatch [:on-status-api :contact %]))))
|
(.then (.getContactCode js/ethereumBeta.status) #(re-frame/dispatch [:on-status-api :contact %]))))
|
||||||
100)
|
100)
|
||||||
(js/Web3. js/ethereumBeta))
|
(js/Web3. js/ethereumBeta))
|
||||||
(when js/ethereum
|
(when (exists? js/ethereum)
|
||||||
(js/setTimeout (fn []
|
(js/setTimeout (fn []
|
||||||
(.then (.enable js/ethereum) #(re-frame/dispatch [:set-default-account]))
|
(.then (.enable js/ethereum) #(re-frame/dispatch [:set-default-account]))
|
||||||
(when js/ethereum.status
|
(when js/ethereum.status
|
||||||
|
|
|
@ -110,7 +110,7 @@
|
||||||
(fn [{{:keys [web3] :as db} :db} _]
|
(fn [{{:keys [web3] :as db} :db} _]
|
||||||
(println "WEB3" web3)
|
(println "WEB3" web3)
|
||||||
(when web3
|
(when web3
|
||||||
{:db (if js/window.ethereumBeta
|
{:db (if (exists? js/window.ethereumBeta)
|
||||||
db
|
db
|
||||||
(update db :web3-async-data
|
(update db :web3-async-data
|
||||||
assoc
|
assoc
|
||||||
|
|
Loading…
Reference in New Issue