add bypass getPolls when no polls

This commit is contained in:
Barry Gitarts 2018-06-28 09:03:58 -04:00
parent f83aa448c4
commit 227c01e853

View File

@ -40,7 +40,9 @@ class App extends React.Component {
const { nPolls, poll } = PollManager.methods;
const polls = await nPolls.call();
const total = await polls.call();
getPolls(total, poll).then(rawPolls => { this.setState({ rawPolls })});
console.log('total', total, polls);
if (total) getPolls(total, poll).then(rawPolls => { this.setState({ rawPolls })});
else this.setState({ rawPolls: [] });
}
_renderStatus(title, available) {