Open baronson11 opened 6 years ago
can you tell me at what stage are you in, I was facing the same error in displaying the candidates before implementing the "votes code" so I removed all the votes related functions from app.js and it worked.
P.S: try to inspect element in chrome and see what error you are getting.
Hope this helps!
@iridescent995 hey there! I have the same problem... migration stage was passed successfully but app doesnt work after launching (npm run dev):
try this:
initWeb3: function () {
// TODO: refactor conditional
if (typeof web3 !== 'undefined') {
// If a web3 instance is already provided by Meta Mask.
App.web3Provider = web3.currentProvider;
ethereum.enable();
web3 = new Web3(web3.currentProvider);
} else {
// Specify default instance if no web3 instance provided
App.web3Provider = new Web3.providers.HttpProvider('http://localhost:7545');
ethereum.enable();
web3 = new Web3(App.web3Provider);
}
return App.initContract();
}
The candidates were not displayed. I commented off the content.hide() statement in the render function() as shown below:
render: function() { var electionInstance; var loader = $("#loader"); var content = $("#content");
loader.show();
//content.hide();
// Load account data
web3.eth.getCoinbase(function(err, account) {
if (err === null) {
App.account = account;
$("#accountAddress").html("Your Account: " + account);
}
});
Any help with this is appreciated. Restarting chrome doesnt help.