Browse Source

Fix incorrect campaign counts on dashboard

Kailash Nadh 6 years ago
parent
commit
08717528c5
1 changed files with 7 additions and 2 deletions
  1. 7 2
      frontend/my/src/Dashboard.js

+ 7 - 2
frontend/my/src/Dashboard.js

@@ -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>