<commit_before>import React from 'react';
import UserMessageRecord from '../records/user_message_record';

require('../../css/snackbar.scss');

const CLOSE_DELAY = 2000;

class Snackbar extends React.Component {
  componentDidMount() {
    if (this.props.userMessage.message && this.props.userMessage.autoClose) {
      this.setCloseTimer();
    } else {
      clearTimeout(this.closeTimer);
    }
  }

  componentWillReceiveProps(nextProps) {
    if (nextProps.userMessage.message && nextProps.userMessage.autoClose) {
      this.setCloseTimer();
    } else {
      clearTimeout(this.closeTimer);
    }
  }

  setCloseTimer() {
    clearTimeout(this.closeTimer);
    this.closeTimer = setTimeout(() => {
      this.props.onMessageTimeout();<commit_msg>Bump snackbar close delay to 8 seconds<commit_after>import React from 'react';
import UserMessageRecord from '../records/user_message_record';

require('../../css/snackbar.scss');

const CLOSE_DELAY = 8000;

class Snackbar extends React.Component {
  componentDidMount() {
    if (this.props.userMessage.message && this.props.userMessage.autoClose) {
      this.setCloseTimer();
    } else {
      clearTimeout(this.closeTimer);
    }
  }

  componentWillReceiveProps(nextProps) {
    if (nextProps.userMessage.message && nextProps.userMessage.autoClose) {
      this.setCloseTimer();
    } else {
      clearTimeout(this.closeTimer);
    }
  }

  setCloseTimer() {
    clearTimeout(this.closeTimer);
    this.closeTimer = setTimeout(() => {
      this.props.onMessageTimeout();
{'fraction_non_alphanumeric': 0.13063357282821686, 'fraction_numerical': 0.005878510777269758, 'mean_word_length': 3.6283987915407856, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '355064', 'n_tokens_mistral': 477, 'n_tokens_neox': 462, 'n_words': 75}