Fix incorrect campaign counts on dashboard

This commit is contained in:
Kailash Nadh 2018-11-06 16:18:52 +05:30
parent b333d05609
commit 08717528c5
1 changed files with 7 additions and 2 deletions

View File

@ -104,10 +104,15 @@ class Dashboard extends React.PureComponent {
<Col span={ 6 } offset={ 2 }> <Col span={ 6 } offset={ 2 }>
<Card title="Campaigns" bordered={ false } className="campaign-counts"> <Card title="Campaigns" bordered={ false } className="campaign-counts">
{ this.campaignTypes.map((key, count) => { this.campaignTypes.map((key) =>
<Row key={ `stats-campaigns-${ key }` }> <Row key={ `stats-campaigns-${ key }` }>
<Col span={ 18 }><h1 className="name">{ key }</h1></Col> <Col span={ 18 }><h1 className="name">{ key }</h1></Col>
<Col span={ 6 }><h1 className="count">{ count }</h1></Col> <Col span={ 6 }>
<h1 className="count">
{ this.state.stats.campaigns.hasOwnProperty(key) ?
this.state.stats.campaigns[key] : 0 }
</h1>
</Col>
</Row> </Row>
)} )}
</Card> </Card>