Fixes joining of quizzes

parent 71ff1470
......@@ -177,7 +177,7 @@ export class HomeComponent implements OnInit, OnDestroy {
this.selectQuizByList(quizname);
this.router.navigate(['/quiz', this.enteredSessionName]);
this.router.navigate(['/quiz', quizname]);
}
public showQuiznameDatalist(): void {
......@@ -390,7 +390,6 @@ export class HomeComponent implements OnInit, OnDestroy {
private selectQuizAsDefaultQuiz(quizName: string): void {
this.quizApiService.getQuizStatus(quizName).subscribe(value => {
console.log('http returned', value);
if (value.status === 'STATUS:SUCCESSFUL') {
switch (value.step) {
case 'QUIZ:EXISTS':
......
......@@ -96,9 +96,11 @@ export class NicknameInputComponent implements OnInit, OnDestroy {
}
public ngOnInit(): void {
if (this.attendeeService.getOwnNick()) {
this.router.navigate(['/']);
}
this.attendeeService.getOwnNick().then(nick => {
if (nick) {
this.router.navigate(['/']);
}
});
}
public ngOnDestroy(): void {
......
......@@ -99,10 +99,11 @@ export class NicknameSelectComponent implements OnInit, OnDestroy {
}
public ngOnInit(): void {
if (this.attendeeService.getOwnNick()) {
this.router.navigate(['/']);
return;
}
this.attendeeService.getOwnNick().then(nick => {
if (nick) {
this.router.navigate(['/']);
}
});
this._isLoading = true;
this.memberApiService.getAvailableMemberNames(this.currentQuizService.quiz.hashtag).subscribe(data => {
this._isLoading = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment