fix nPoll function call
This commit is contained in:
parent
ffabc6c351
commit
e5f880680d
|
@ -40,9 +40,8 @@ class App extends React.Component {
|
||||||
|
|
||||||
_getPolls = async () => {
|
_getPolls = async () => {
|
||||||
const { nPolls, poll } = PollManager.methods;
|
const { nPolls, poll } = PollManager.methods;
|
||||||
const polls = await nPolls.call();
|
const polls = await nPolls().call();
|
||||||
const total = await polls.call();
|
if (polls) getPolls(polls, poll).then(rawPolls => { this.setState({ rawPolls })});
|
||||||
if (total) getPolls(total, poll).then(rawPolls => { this.setState({ rawPolls })});
|
|
||||||
else this.setState({ rawPolls: [] });
|
else this.setState({ rawPolls: [] });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue