Created
April 11, 2016 21:35
-
-
Save colinta/8d73822c5ba4ce7efa78b7b25ae93499 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/components/posts/PostTools.js b/src/components/posts/PostTools.js | |
index b69f64f..a9b04cb 100644 | |
--- a/src/components/posts/PostTools.js | |
+++ b/src/components/posts/PostTools.js | |
@@ -172,9 +172,13 @@ class PostTools extends Component { | |
}; | |
toggleComments = () => { | |
- const { dispatch, post } = this.props | |
+ const { author, dispatch, isLoggedIn, post } = this.props | |
+ if (isLoggedIn) { | |
const showComments = !post.showComments | |
dispatch(postActions.toggleComments(post, showComments)) | |
+ } else { | |
+ dispatch(routeActions.push(`/${author.username}/post/${post.token}`)) | |
+ } | |
}; | |
lovePost = () => { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment