<commit_before>import {Component, OnInit} from "@angular/core";
import {ROUTER_DIRECTIVES, Router} from "@angular/router";
import {ProjectDataService} from "../project-data.service";
import {Subscription} from "rxjs/Rx";

@Component({
	moduleId: module.id,
	selector: 'emudbmanager-welcome',
	templateUrl: 'welcome.component.html',
	styleUrls: ['welcome.component.css'],
	directives: [ROUTER_DIRECTIVES]
})
export class WelcomeComponent implements OnInit {
	private loginFailed:boolean = false;
	private password:string;
	private sub:Subscription;
	private unknownError:boolean = false;
	private username:string;

	constructor(private projectDataService:ProjectDataService,
	            private router:Router) {
	}

	ngOnInit() {
	}

	private checkLogin() {
		this.loginFailed = false;

		if (this.sub) {
			return;
		}

		this.sub = this.projectDataService.login(this.username, this.password).subscribe(next => {
			this.router.navigate(['/project/overview']);
			this.sub = null;
		}, error => {
			if (error === 'BADLOGIN') {
				this.loginFailed = true;
			} else {
				this.unknownError = true;
			}
			this.sub = null;
		});
	}
}<commit_msg>fixed bugs in welcome screen<commit_after>import {Component, OnInit} from "@angular/core";
import {ROUTER_DIRECTIVES, Router} from "@angular/router";
import {ProjectDataService} from "../project-data.service";
import {Subscription} from "rxjs/Rx";

@Component({
	moduleId: module.id,
	selector: 'emudbmanager-welcome',
	templateUrl: 'welcome.component.html',
	styleUrls: ['welcome.component.css'],
	directives: [ROUTER_DIRECTIVES]
})
export class WelcomeComponent implements OnInit {
	private loginFailed:boolean = false;
	private password:string;
	private sub:Subscription;
	private unknownError:boolean = false;
	private username:string;

	constructor(private projectDataService:ProjectDataService,
	            private router:Router) {
	}

	ngOnInit() {
	}

	private checkLogin() {
		this.loginFailed = false;
		this.unknownError = false;

		if (this.sub) {
			return;
		}

		this.sub = this.projectDataService.login(this.username, this.password).subscribe(next => {
			this.router.navigate(['/project/overview']);
			this.sub.unsubscribe();
			this.sub = null;
		}, error => {
			console.log(error);
			if (error === 'BADLOGIN') {
				this.loginFailed = true;
			} else {
				this.unknownError = true;
			}
			this.sub.unsubscribe();
			this.sub = null;
		});
	}
}
{'fraction_non_alphanumeric': 0.13871635610766045, 'fraction_numerical': 0.0, 'mean_word_length': 4.392857142857143, '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': '1992942', 'n_tokens_mistral': 839, 'n_tokens_neox': 768, 'n_words': 159}