<commit_before>import Ractive from 'ractive';
import html from './welcome.ract';
import navbar from '../navbar/navbar.ract';
import storage from '../services/storage.es6';

class Welcome {



    constructor(auth, events, estimationSessions) {
        this.events = events;
        this.auth = auth;
        this.estimationSessions = estimationSessions;
    }

    render() {
        let loggedInUser = storage.memory.get('user');
        this.ractive = new Ractive({
            el: 'view',
            template: html,
            partials: {navbar: navbar},
            data: function () {
                return {
                    user: loggedInUser,
                    sms: [],
                    sessionStarted: false
                };
            }
        });

        this.ractive.on('logout', () => this.logout());
        this.ractive.on('startEstimationSession', () => this.startEstimationSession(this.ractive.get('estimationSessionName')));

        this.events.sms.receivedSms.add((message) => this.ractive.push('sms', message));
    }

    logout() {
        this.auth.clearLogin();
        this.events.routing.transitionTo.dispatch('home', this);
    }

    isProtected() {
        return true;
    }

    unrender() {
        this.events.sms.receivedSms.removeAll();
        return this.ractive.teardown();
    }

    startEstimationSession(name) {


        this.estimationSession = this.estimationSessions.create(name);
        console.log(this.estimationSession);

        this.ractive.set('sessionStarted', true);
    }
}<commit_msg>fix(web-client): logout button stopped working<commit_after>import Ractive from 'ractive';
import html from './welcome.ract';
import navbar from '../navbar/navbar.ract';
import storage from '../services/storage.es6';

class Welcome {

  constructor(auth, events, estimationSessions) {
    this.events = events;
    this.auth = auth;
    this.estimationSessions = estimationSessions;
  }

  render() {
    let loggedInUser = storage.memory.get('user');
    this.ractive = new Ractive({
      el: 'view',
      template: html,
      partials: {navbar: navbar},
      data: function() {
        return {
          user: loggedInUser,
          sms: [],
          sessionStarted: false
        };
      }
    });

    this.ractive.on('logout', () => this.logout());
    this.ractive.on('startEstimationSession', () => this.startEstimationSession(this.ractive.get('estimationSessionName')));
  }

  logout() {
    this.auth.clearLogin();
    this.events.routing.transitionTo.dispatch('home', this);
  }

  isProtected() {
    return true;
  }

  unrender() {
    return this.ractive.teardown();
  }

  startEstimationSession(name) {
    this.estimationSession = this.estimationSessions.create(name);
    this.ractive.set('sessionStarted', true);
  }
}
{'fraction_non_alphanumeric': 0.13903743315508021, 'fraction_numerical': 0.00071301247771836, 'mean_word_length': 2.4514145141451413, 'pattern_counts': {'":': 0, '<': 3, '<?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': '351623', 'n_tokens_mistral': 850, 'n_tokens_neox': 802, 'n_words': 145}