mirror of
https://github.com/wassname/talk.git
synced 2026-07-02 05:17:05 +08:00
Merge pull request #302 from coralproject/like-bugfix
fix very annoying Like bug
This commit is contained in:
@@ -42,8 +42,8 @@ class LikeButton extends Component {
|
||||
if (currentUser.banned) {
|
||||
return;
|
||||
}
|
||||
if (!liked) {
|
||||
this.setState({localPost: 'temp', localDelete: false});
|
||||
if (!liked) { // this comment has not yet been liked by this user.
|
||||
this.setState({localPost: 'temp'});
|
||||
postLike({
|
||||
item_id: id,
|
||||
item_type: 'COMMENTS'
|
||||
@@ -58,11 +58,7 @@ class LikeButton extends Component {
|
||||
|
||||
return <div className={`${name}-container`}>
|
||||
<button onClick={onLikeClick} className={`${name}-button ${liked && 'likedButton'}`}>
|
||||
{
|
||||
liked
|
||||
? <span className={`${name}-button-text`}>{lang.t('liked')}</span>
|
||||
: <span className={`${name}-button-text`}>{lang.t('like')}</span>
|
||||
}
|
||||
<span className={`${name}-button-text`}>{lang.t(liked ? 'liked' : 'like')}</span>
|
||||
<i className={`${name}-icon material-icons`}
|
||||
aria-hidden={true}>thumb_up</i>
|
||||
<span className={`${name}-like-count`}>{count > 0 && count}</span>
|
||||
|
||||
Reference in New Issue
Block a user