<commit_before>import React from 'react';
import { connect } from 'react-redux';
import classnames from 'classnames';
import { Tooltip } from 'react-tippy';

import { makeGetClikes } from '../../redux/selectors';
import { postActions } from '../../redux/select-utils';
import UserName from './user-name';
import throbber16 from 'assets/images/throbber-16.gif';

const renderClike = (item, i, items) => (
  <li key={item.id}>
    <UserName user={item} display={item.username}/>

    {i < items.length - 2 ? (
      <span>, </span>
    ) : i === items.length - 2 ? (
      <span> and </span>
    ) : (
      <span> liked this</span>
    )}
  </li>
);

class PostCommentLikes extends React.Component {
  constructor(props) {
    super(props);

    this.state = {
      isOpen: false
    };
  }

  toggleLike = () => {
    if (!this.props.hasOwnLike) {
      this.props.likeComment(this.props.commentId);
    } else {
      this.props.unlikeComment(this.props.commentId);
    }
  };

  handleClick = () => {
    if (!this.state.isOpen) {
      this.setState({ isOpen: true });
    } else {
      this.toggleLike();<commit_msg>clikes: Handle accidental double-clicks<commit_after>import React from 'react';
import { connect } from 'react-redux';
import classnames from 'classnames';
import { Tooltip } from 'react-tippy';

import { makeGetClikes } from '../../redux/selectors';
import { postActions } from '../../redux/select-utils';
import UserName from './user-name';
import throbber16 from 'assets/images/throbber-16.gif';

const renderClike = (item, i, items) => (
  <li key={item.id}>
    <UserName user={item} display={item.username}/>

    {i < items.length - 2 ? (
      <span>, </span>
    ) : i === items.length - 2 ? (
      <span> and </span>
    ) : (
      <span> liked this</span>
    )}
  </li>
);

class PostCommentLikes extends React.Component {
  constructor(props) {
    super(props);

    this.state = {
      isOpen: false
    };
  }

  toggleLike = () => {
    if (this.props.isLiking) {
      return;
    }

    if (!this.props.hasOwnLike) {
      this.props.likeComment(this.props.commentId);
    } else {
      this.props.unlikeComment(this.props.commentId);
    }
  };

  handleClick = () => {
    if (!this.state.isOpen) {
      this.setState({ isOpen: true });
    } else {
      this.toggleLike();
{'fraction_non_alphanumeric': 0.17183462532299743, 'fraction_numerical': 0.00516795865633075, 'mean_word_length': 2.704944178628389, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7050950', 'n_tokens_mistral': 791, 'n_tokens_neox': 778, 'n_words': 165}