fix contracts loading; add warning for whisper version; update web3.js

This commit is contained in:
Iuri Matias 2017-06-25 12:56:14 -04:00
parent 955aab35de
commit 84f7149aaf
4 changed files with 2898 additions and 2758 deletions

View File

@ -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();
}

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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}";