<commit_before>import React, { PropTypes } from "react";
import { connect } from "react-redux";

import ControlRequest from "../utils/ControlRequest";
import propTypeSymbol from "../utils/propTypeSymbol";
import {
    LOGIN_STATUS_UNKNOWN,
    LOGIN_STATUS_PENDING,
    LOGIN_STATUS_SUCCESS,
    LOGIN_STATUS_FAILURE
} from "../constants/login";

const ID = "login-status-pane";

const INTERVAL_MSEC = 60 * 1000;

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

    componentDidMount() {
        const fetchStatus = () => {
            this.props.socketSend(ControlRequest.loginStatus());
        };
        fetchStatus();
        // Refresh login status periodically
        this.interval_id = setInterval(fetchStatus, INTERVAL_MSEC);
    }

    componentWillUnmount() {
        clearInterval(this.interval_id);
    }

    render_unknown() {
        return (
            <div id={ID}>
                Fetching login status...
            </div><commit_msg>Do not auto-refresh login status.<commit_after>import React, { PropTypes } from "react";
import { connect } from "react-redux";

import ControlRequest from "../utils/ControlRequest";
import propTypeSymbol from "../utils/propTypeSymbol";
import {
    LOGIN_STATUS_UNKNOWN,
    LOGIN_STATUS_PENDING,
    LOGIN_STATUS_SUCCESS,
    LOGIN_STATUS_FAILURE
} from "../constants/login";

const ID = "login-status-pane";

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

    componentDidMount() {
        this.props.socketSend(ControlRequest.loginStatus());
    }

    render_unknown() {
        return (
            <div id={ID}>
                Fetching login status...
            </div>
{'fraction_non_alphanumeric': 0.11353211009174312, 'fraction_numerical': 0.0034403669724770644, 'mean_word_length': 2.7286324786324787, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, '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': '1666261', 'n_tokens_mistral': 502, 'n_tokens_neox': 495, 'n_words': 105}