<commit_before>import {Injectable} from 'angular2/core';
import {Storage, LocalStorage, Events} from 'ionic-framework/ionic';


@Injectable()
export class UserData {
  _favorites = [];
  HAS_LOGGED_IN: string = 'hasLoggedIn';

  constructor(private events: Events) {
    this.storage = new Storage(LocalStorage);
  }

  hasFavorite(sessionName) {
    return (this._favorites.indexOf(sessionName) > -1);
  }

  addFavorite(sessionName) {
    this._favorites.push(sessionName);
  }

  removeFavorite(sessionName) {
    let index = this._favorites.indexOf(sessionName)
    if (index > -1) {
      this._favorites.splice(index, 1);
    }
  }

  login() {
    //this.storage.set(this.HAS_LOGGED_IN, true);
    this.events.publish('user:login');
  }

  signup() {
    //this.storage.set(this.HAS_LOGGED_IN, true);<commit_msg>chore(): fix user-data type error<commit_after>import {Injectable} from 'angular2/core';
import {Storage, LocalStorage, Events} from 'ionic-framework/ionic';


@Injectable()
export class UserData {
  _favorites = [];
  HAS_LOGGED_IN = 'hasLoggedIn';
  storage = new Storage(LocalStorage);

  constructor(private events: Events) {}

  hasFavorite(sessionName) {
    return (this._favorites.indexOf(sessionName) > -1);
  }

  addFavorite(sessionName) {
    this._favorites.push(sessionName);
  }

  removeFavorite(sessionName) {
    let index = this._favorites.indexOf(sessionName)
    if (index > -1) {
      this._favorites.splice(index, 1);
    }
  }

  login() {
    //this.storage.set(this.HAS_LOGGED_IN, true);
    this.events.publish('user:login');
  }

  signup() {
    //this.storage.set(this.HAS_LOGGED_IN, true);
{'fraction_non_alphanumeric': 0.14390243902439023, 'fraction_numerical': 0.004878048780487805, 'mean_word_length': 3.8985074626865672, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '209643', 'n_tokens_mistral': 592, 'n_tokens_neox': 573, 'n_words': 94}