mirror of
https://github.com/status-im/open-bounty.git
synced 2025-02-23 06:38:09 +00:00
Fix issues with injected web3 and advanced cljs compilation
* use stub js for web3 externs * upgrade clojurescript Fixes: #21
This commit is contained in:
parent
66a65277ae
commit
2d2d11fc9d
12
externs/web3-externs.js
Normal file
12
externs/web3-externs.js
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
/*
|
||||
externs for web3 injected into js context. needed for things to work with advanced cljs compilation
|
||||
|
||||
TODO: probably not a good idea to maintain this manually in the long run*/
|
||||
|
||||
var web3 = {
|
||||
eth: {
|
||||
accounts: [],
|
||||
sendTransaction: function() {}
|
||||
}
|
||||
};
|
@ -9,7 +9,7 @@
|
||||
[secretary "1.2.3"]
|
||||
[reagent-utils "0.2.0"]
|
||||
[reagent "0.6.0"]
|
||||
[org.clojure/clojurescript "1.9.456" :scope "provided"]
|
||||
[org.clojure/clojurescript "1.9.473"]
|
||||
[org.clojure/clojure "1.8.0"]
|
||||
[selmer "1.10.5"]
|
||||
[markdown-clj "0.9.93"]
|
||||
@ -84,12 +84,13 @@
|
||||
{:source-paths ["src/cljc" "src/cljs" "env/prod/cljs"]
|
||||
:compiler
|
||||
{:output-to "target/cljsbuild/public/js/app.js"
|
||||
:externs ["react/externs/react.js"]
|
||||
:externs ["externs/web3-externs.js"]
|
||||
:optimizations :advanced
|
||||
:pretty-print false
|
||||
:closure-defines {goog.DEBUG false}
|
||||
:closure-warnings
|
||||
{:externs-validation :off :non-standard-jsdoc :off}}}}}
|
||||
{:externs-validation :off
|
||||
:non-standard-jsdoc :off}}}}}
|
||||
|
||||
|
||||
:aot :all
|
||||
|
@ -8,13 +8,13 @@
|
||||
(defn update-address-page []
|
||||
(let [user (rf/subscribe [:user])
|
||||
updating-address (rf/subscribe [:get-in [:updating-address]])
|
||||
web3 (.-web3 js/window)
|
||||
address (r/atom @(rf/subscribe [:get-in [:user :address]]))]
|
||||
(fn []
|
||||
(let [web3 (.-web3 js/window)
|
||||
web3-accounts (into [] (when-not (nil? web3) (-> web3
|
||||
.-eth
|
||||
.-accounts
|
||||
js->clj)))
|
||||
address (r/atom @(rf/subscribe [:get-in [:user :address]]))]
|
||||
(fn []
|
||||
js->clj)))]
|
||||
(println "web3-accounts" web3-accounts)
|
||||
[:div.ui.container.grid
|
||||
[:div.ui.form.sixteen.wide.column
|
||||
@ -39,4 +39,4 @@
|
||||
@address])}
|
||||
(when @updating-address
|
||||
{:class "busy loading"}))
|
||||
"Update"]]])))
|
||||
"Update"]]]))))
|
||||
|
Loading…
x
Reference in New Issue
Block a user