<commit_before>import React, { Component } from 'react';
import firebase, { signIn, signOut } from '../firebase';
import { pick, map, extend } from 'lodash';
import WelcomeScreen from './WelcomeScreen';
import HomeScreen from './HomeScreen';

import moment from 'moment'

export default class Application extends Component {
  constructor() {
    super();
    this.state = {
      user: null,
      contactzz: [],
    };
  }

  componentDidMount() {
    firebase.auth().onAuthStateChanged((user)=>{
      if(user){
        firebase.database().ref(user.uid).limitToLast(50).on('value', (snapshot) => {
          const contactzz = snapshot.val() || {};
          debugger
          this.setState({
            contactzz: map(contactzz, (val, key) => extend(val, { key })),
          });
        });
      }
    })
}



  signInHandler() {
    signIn().then((fromFirebase) => {
      this.setState({ user: fromFirebase.user });
    });
  }

  addNewContact(newContact) {
    const { user } = this.state;
    firebase.database().ref(user.uid).push({
      contact: pick(newContact, 'name', 'email', 'socialFB', 'followUp', 'notes', 'createdAt'),
    });
  }

  signOutHandler() {
    signOut();
    this.setState({ user: null });
  }

  render() {
    const { user, contactzz } = this.state;
    return (
      <div className="Application">
        <h1 className ='header'>Networkr</h1>
        { user ?
          <HomeScreen
            user={ user }
            contactzz={ contactzz }
            addNewContact={ this.addNewContact.bind(this) }
            signOut={ this.signOutHandler.bind(this) }
          /> :
          <WelcomeScreen
            signIn={ this.signInHandler.bind(this) }
          /> }
      </div>
    );
  }
}<commit_msg>on signout set state of contactzzzzz<commit_after>import React, { Component } from 'react';
import firebase, { signIn, signOut } from '../firebase';
import { pick, map, extend } from 'lodash';
import WelcomeScreen from './WelcomeScreen';
import HomeScreen from './HomeScreen';

import moment from 'moment'

export default class Application extends Component {
  constructor() {
    super();
    this.state = {
      user: null,
      contactzz: [],
    };
  }

  componentDidMount() {
    firebase.auth().onAuthStateChanged((user)=>{
      if(user){
        firebase.database().ref(user.uid).limitToLast(50).on('value', (snapshot) => {
          const contactzz = snapshot.val() || {};
          this.setState({
            contactzz: map(contactzz, (val, key) => extend(val, { key })),
          });
        });
      }
    })
}



  signInHandler() {
    signIn().then((fromFirebase) => {
      this.setState({ user: fromFirebase.user });
    });
  }

  addNewContact(newContact) {
    const { user } = this.state;
    firebase.database().ref(user.uid).push({
      contact: pick(newContact, 'name', 'email', 'socialFB', 'followUp', 'notes', 'createdAt'),
    });
  }

  signOutHandler() {
    signOut();
    this.setState({ user: null, contactzz: [] });
  }

  render() {
    const { user, contactzz } = this.state;
    return (
      <div className="Application">
        <h1 className ='header'>Networkr</h1>
        { user ?
          <HomeScreen
            user={ user }
            contactzz={ contactzz }
            addNewContact={ this.addNewContact.bind(this) }
            signOut={ this.signOutHandler.bind(this) }
          /> :
          <WelcomeScreen
            signIn={ this.signInHandler.bind(this) }
          /> }
      </div>
    );
  }
}
{'fraction_non_alphanumeric': 0.1602509267179926, 'fraction_numerical': 0.0022811519817507843, 'mean_word_length': 2.3505253104106973, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 23, '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': '4599833', 'n_tokens_mistral': 1069, 'n_tokens_neox': 1051, 'n_words': 215}