From aaa2da6c237185a7e4dc2b03dcdf107aadf56a26 Mon Sep 17 00:00:00 2001 From: Benjamin Goering Date: Thu, 18 May 2017 10:43:38 -0700 Subject: [PATCH] Stream container refetch then setCommentCountCache to asset.commentCount instead of silly zero --- client/coral-embed-stream/src/containers/Stream.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/coral-embed-stream/src/containers/Stream.js b/client/coral-embed-stream/src/containers/Stream.js index b54e69dd6..467242592 100644 --- a/client/coral-embed-stream/src/containers/Stream.js +++ b/client/coral-embed-stream/src/containers/Stream.js @@ -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);