Skip to content

Commit

Permalink
fix(comments): fix long press click error (#384)
Browse files Browse the repository at this point in the history
* fix(issue_comment_actions): long press click error

Before this patch the long press event in comment list item worked
in comments from other users, this action should work the logger
user comments.

* fix(issue_comment_actions): Use disabled props in Touchable element
  • Loading branch information
jouderianjr authored and Houssein Djirdeh committed Sep 30, 2017
1 parent d162064 commit 69cb386
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/comment-list-item.component.js
Expand Up @@ -143,13 +143,16 @@ class CommentListItemComponent extends Component {
translate('issue.comment.deleteAction', language),
];

const isActionButtonVisible =
const isActionMenuEnabled =
comment.user &&
authUser.login === comment.user.login &&
!this.isIssueDescription();

return (
<TouchableWithoutFeedback onLongPress={this.showMenu}>
<TouchableWithoutFeedback
disabled={!isActionMenuEnabled}
onLongPress={this.showMenu}
>
<View style={styles.container}>
<View style={styles.header}>
{comment.user && (
Expand Down Expand Up @@ -208,7 +211,7 @@ class CommentListItemComponent extends Component {
onLinkPress={onLinkPress}
/>

{isActionButtonVisible && (
{isActionMenuEnabled && (
<View style={styles.actionButtonIconContainer}>
<Icon
color={colors.grey}
Expand Down

0 comments on commit 69cb386

Please sign in to comment.