<commit_before>import { Component, OnInit, OnDestroy } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { SessionService } from '../shared/model/session.service';
import { Session } from '../shared/model/session';
import { User } from '../shared/model/user';
import { UserService, userStatus } from '../shared/model/user.service';
import { WhiteboardComponent } from '../whiteboard/whiteboard.component';

@Component({
	selector: 'app-session',
	templateUrl: './session.component.html',
	styleUrls: ['./session.component.scss']
})
export class SessionComponent implements OnInit, OnDestroy {

	sessionId: string;
	sessionExist: boolean;
	sessionInfo: Session;
	onlineUsers: User[] = [];

	constructor(private route:  ActivatedRoute, private sessionService: SessionService, private userService: UserService) { }

	ngOnInit() {
		this.route.params.subscribe(val => {
			this.sessionId = val['id'];
			this.sessionService.findSession(this.sessionId).take(2).subscribe(val => {
				this.sessionExist = true;
				this.sessionInfo = val;
				console.log(val.chat);
				this.sessionService.joinSession(this.sessionId).subscribe(val => {}, console.error,
				() => {
					this.sessionService.getOnlineUsers(this.sessionId).subscribe(val => {
						let allUsers = this.sessionInfo.tutees.concat(this.sessionInfo.tutor);
						// The online state is just [uid]:boolean i wanted to preserve the boolean that represented the online state so i didn't convert the uid into a user object
						let onlineUsers = [];
						val.forEach(userOnlineState => {
							if (userOnlineState.$value) {
								onlineUsers.push(allUsers.find(user => user.$key === userOnlineState.$key));
							}
						});
						this.onlineUsers = onlineUsers;
					}, console.error);
				});
			},
			err => {
				console.error(err);
				this.sessionExist = false;
			});
		}, console.error);
	}<commit_msg>fix linting issues<commit_after>import { Component, OnInit, OnDestroy } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { SessionService } from '../shared/model/session.service';
import { Session } from '../shared/model/session';
import { User } from '../shared/model/user';
import { UserService } from '../shared/model/user.service';

@Component({
	selector: 'app-session',
	templateUrl: './session.component.html',
	styleUrls: ['./session.component.scss']
})
export class SessionComponent implements OnInit, OnDestroy {

	sessionId: string;
	sessionExist: boolean;
	sessionInfo: Session;
	onlineUsers: User[] = [];

	constructor(private route:  ActivatedRoute, private sessionService: SessionService, private userService: UserService) { }

	ngOnInit() {
		this.route.params.subscribe(params => {
			this.sessionId = params['id'];
			this.sessionService.findSession(this.sessionId).take(2).subscribe(session => {
				this.sessionExist = true;
				this.sessionInfo = session;
				console.log(session.chat);
				this.sessionService.joinSession(this.sessionId).subscribe(data => {}, console.error,
				() => {
					this.sessionService.getOnlineUsers(this.sessionId).subscribe(userIds => {
						let allUsers = this.sessionInfo.tutees.concat(this.sessionInfo.tutor);
						// The online state is just [uid]:boolean i wanted to preserve the boolean that 
						// represented the online state so i didn't convert the uid into a user object
						let onlineUsers = [];
						userIds.forEach(userOnlineState => {
							if (userOnlineState.$value) {
								onlineUsers.push(allUsers.find(user => user.$key === userOnlineState.$key));
							}
						});
						this.onlineUsers = onlineUsers;
					}, console.error);
				});
			},
			err => {
				console.error(err);
				this.sessionExist = false;
			});
		}, console.error);
	}
{'fraction_non_alphanumeric': 0.14381003201707576, 'fraction_numerical': 0.0005336179295624333, 'mean_word_length': 3.8374193548387097, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '1196093', 'n_tokens_mistral': 1280, 'n_tokens_neox': 1071, 'n_words': 237}