Stream container refetch then setCommentCountCache to asset.commentCount instead of silly zero

This commit is contained in:
Benjamin Goering
2017-05-18 10:43:38 -07:00
parent cfc6d4bfea
commit aaa2da6c23
@@ -113,7 +113,9 @@ class StreamContainer extends React.Component {
componentDidMount() {
if (this.props.previousTab) {
this.props.data.refetch()
.then(() => this.props.setCommentCountCache(0));
.then(({data: {asset: {commentCount}}}) => {
return this.props.setCommentCountCache(commentCount);
});
}
this.countPoll = setInterval(() => {
this.getCounts(this.props.data.variables);