mirror of https://github.com/embarklabs/embark.git
fix contracts loading; add warning for whisper version; update web3.js
This commit is contained in:
parent
955aab35de
commit
84f7149aaf
|
@ -372,6 +372,8 @@ var EmbarkJS =
|
|||
web3.version.getWhisper(function(err, res) {
|
||||
if (err) {
|
||||
console.log("whisper not available");
|
||||
} else if (web3.version.whisper >= 5) {
|
||||
console.log("this version of whisper is not supported yet; try a version of geth bellow 1.6.1");
|
||||
} else {
|
||||
self.currentMessages.identity = web3.shh.newIdentity();
|
||||
}
|
||||
|
|
|
@ -325,6 +325,8 @@ EmbarkJS.Messages.setProvider = function(provider, options) {
|
|||
web3.version.getWhisper(function(err, res) {
|
||||
if (err) {
|
||||
console.log("whisper not available");
|
||||
} else if (web3.version.whisper >= 5) {
|
||||
console.log("this version of whisper is not supported yet; try a version of geth bellow 1.6.1");
|
||||
} else {
|
||||
self.currentMessages.identity = web3.shh.newIdentity();
|
||||
}
|
||||
|
|
5636
js/web3.js
5636
js/web3.js
File diff suppressed because it is too large
Load Diff
|
@ -19,8 +19,8 @@ class ABIGenerator {
|
|||
}
|
||||
|
||||
result += "\nvar whenEnvIsLoaded = function(cb) {";
|
||||
result += "\n if (typeof window !== 'undefined' && window !== null) {";
|
||||
result += "\n window.addEventListener('load', cb);";
|
||||
result += "\n if (typeof document !== 'undefined' && document !== null) {";
|
||||
result += "\n document.addEventListener('DOMContentLoaded', cb);";
|
||||
result += "\n } else {";
|
||||
result += "\n cb();";
|
||||
result += "\n }";
|
||||
|
@ -73,11 +73,13 @@ class ABIGenerator {
|
|||
let gasEstimates = JSON.stringify(contract.gasEstimates);
|
||||
|
||||
// TODO: refactor this
|
||||
result += "\nvar whenEnvIsLoaded = function(cb) {";
|
||||
result += "\n if (typeof window !== 'undefined' && window !== null) {";
|
||||
result += "\n window.addEventListener('load', cb);";
|
||||
result += "\n } else {";
|
||||
result += "\n cb();";
|
||||
result += "\nif (whenEnvIsLoaded === undefined) {";
|
||||
result += "\n var whenEnvIsLoaded = function(cb) {";
|
||||
result += "\n if (typeof document !== 'undefined' && document !== null) {";
|
||||
result += "\n document.addEventListener('DOMContentLoaded', cb);";
|
||||
result += "\n } else {";
|
||||
result += "\n cb();";
|
||||
result += "\n }";
|
||||
result += "\n }";
|
||||
result += "\n}";
|
||||
|
||||
|
|
Loading…
Reference in New Issue