<commit_before>import { Component, OnInit, ViewChild } from '@angular/core';
import { AppState } from '../../app.service';
import { ActivatedRoute, Router, NavigationStart } from '@angular/router';
import { MdSidenav } from '@angular/material';

const profileTransforms = 'c_fill,g_face,h_200,q_auto:best,r_max,w_200';
const defaultPictureUrl =
  `http://res.cloudinary.com/wagoid/image/upload/${profileTransforms}/empty-profile_h8q7mo.png`;

@Component({
  selector: 'menu',
  styleUrls: ['./menu-components.scss'],
  templateUrl: './menu.components.html'
})
export class MenuComponent implements OnInit {
  public defaultPictureUrl: string = defaultPictureUrl;
  @ViewChild('sidenav') public sidenav: MdSidenav;

  constructor(
    public route: ActivatedRoute,
    private router: Router,
    public appState: AppState
  ) {
    this.appState.set('defaultPictureUrl', this.defaultPictureUrl);
  }

  public ngOnInit() {
    this.router.events.subscribe((event) => {
      if (event instanceof NavigationStart) {
        this.sidenav.close();
      }
    });
  }

  public isAdmin() {
    return this.appState.state.user.roles && this.appState.state.user.roles.indexOf('admin') !== -1;
  }

  public toProjects() {
    console.log('to projects');
  }

  public toParents() {
    console.log('to parents');
  }

  public tostudents() {
    console.log('to students');
  }

  public logout() {
    localStorage.setItem('token', null);<commit_msg>Add localStorage.removeItem instead of setting value to null<commit_after>import { Component, OnInit, ViewChild } from '@angular/core';
import { AppState } from '../../app.service';
import { ActivatedRoute, Router, NavigationStart } from '@angular/router';
import { MdSidenav } from '@angular/material';

const profileTransforms = 'c_fill,g_face,h_200,q_auto:best,r_max,w_200';
const defaultPictureUrl =
  `http://res.cloudinary.com/wagoid/image/upload/${profileTransforms}/empty-profile_h8q7mo.png`;

@Component({
  selector: 'menu',
  styleUrls: ['./menu-components.scss'],
  templateUrl: './menu.components.html'
})
export class MenuComponent implements OnInit {
  public defaultPictureUrl: string = defaultPictureUrl;
  @ViewChild('sidenav') public sidenav: MdSidenav;

  constructor(
    public route: ActivatedRoute,
    private router: Router,
    public appState: AppState
  ) {
    this.appState.set('defaultPictureUrl', this.defaultPictureUrl);
  }

  public ngOnInit() {
    this.router.events.subscribe((event) => {
      if (event instanceof NavigationStart) {
        this.sidenav.close();
      }
    });
  }

  public isAdmin() {
    return this.appState.state.user.roles && this.appState.state.user.roles.indexOf('admin') !== -1;
  }

  public toProjects() {
    console.log('to projects');
  }

  public toParents() {
    console.log('to parents');
  }

  public tostudents() {
    console.log('to students');
  }

  public logout() {
    localStorage.removeItem('token');
{'fraction_non_alphanumeric': 0.14509536784741145, 'fraction_numerical': 0.006130790190735695, 'mean_word_length': 4.081314878892734, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '112585', 'n_tokens_mistral': 968, 'n_tokens_neox': 933, 'n_words': 181}