{"size": 737, "ext": "js", "max_stars_repo_path": "src/actions/index.js", "max_stars_repo_name": "Bartekus/hackscape", "max_stars_repo_stars_event_min_datetime": "2017-07-30T12:29:06.000Z", "max_stars_repo_stars_event_max_datetime": "2017-09-18T16:17:30.000Z", "max_issues_repo_path": "src/actions/index.js", "max_issues_repo_name": "Bartekus/react-alt-webpack-firebase", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/actions/index.js", "max_forks_repo_name": "Bartekus/react-alt-webpack-firebase", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 19.9189189189, "max_line_length": 73, "alphanum_fraction": 0.591587517}
import alt from '../alt';
import Firebase from 'firebase';

class Actions {
  constructor(){
    this.generateActions(
      'channelsReceived',
      'channelsFailed',
      'messagesReceived',
      'messagesFailed',
      'channelOpened',
      'messagesLoading',
      'sendMessage',
      'messageSendSuccess',
      'messageSendError',
      'messageReceived'
    );
  }

  login(router){
    return (dispatch) => {
      var firebaseRef = new Firebase('https://hackscape.firebaseio.com');
      firebaseRef.authWithOAuthPopup("google", (error, user)=> {
        if(error){
          return;
        }

        dispatch(user);

	      router.transitionTo('/chat');
      });
    }
  }
}

export default alt.createActions(Actions);
