fix nPoll function call

This commit is contained in:
Barry Gitarts 2018-06-30 15:08:47 -04:00
parent ffabc6c351
commit e5f880680d
1 changed files with 2 additions and 3 deletions

View File

@ -40,9 +40,8 @@ class App extends React.Component {
_getPolls = async () => {
const { nPolls, poll } = PollManager.methods;
const polls = await nPolls.call();
const total = await polls.call();
if (total) getPolls(total, poll).then(rawPolls => { this.setState({ rawPolls })});
const polls = await nPolls().call();
if (polls) getPolls(polls, poll).then(rawPolls => { this.setState({ rawPolls })});
else this.setState({ rawPolls: [] });
}