diff --git a/src/app/root/home/home.component.html b/src/app/root/home/home.component.html index 1c4cc8381d168103cb8eac1afd7fe12d24021710..9ae3592a1b0c4998eac7298d95ecca7eebcb8d87 100644 --- a/src/app/root/home/home.component.html +++ b/src/app/root/home/home.component.html @@ -74,8 +74,8 @@ id="startSession" class="btn btn-success btn-block pointer" (click)="handleClick('startSession') && setAsCurrentQuiz(['/quiz', 'flow'])" - [class.disabled]="!canStartQuiz || !serverPassword.length" - [disabled]="!canStartQuiz || !serverPassword.length"> + [class.disabled]="!canStartQuiz || (passwordRequired && !serverPassword.length)" + [disabled]="!canStartQuiz || (passwordRequired && !serverPassword.length)"> {{'component.hashtag_management.start_session' | translate}} diff --git a/src/app/root/home/home.component.ts b/src/app/root/home/home.component.ts index 5d8a0fc55068a69c49b93b59cc00236ccb06fb2e..f01adc9501f902001b776c68acb48a099ac81aa3 100644 --- a/src/app/root/home/home.component.ts +++ b/src/app/root/home/home.component.ts @@ -140,15 +140,6 @@ export class HomeComponent implements OnInit, OnDestroy { this.connectionService.socket.subscribe(data => { this.connectionService.websocketAvailable = true; - - switch (data.step) { - case COMMUNICATION_PROTOCOL.QUIZ.SET_ACTIVE: - this.sharedService.activeQuizzes.push(data.payload.quizName); - break; - case COMMUNICATION_PROTOCOL.QUIZ.SET_INACTIVE: - const index = this.sharedService.activeQuizzes.findIndex(name => name === data.payload.quizName); - this.sharedService.activeQuizzes.splice(index, 1); - } }, () => this.connectionService.websocketAvailable = false); }); } @@ -414,6 +405,7 @@ export class HomeComponent implements OnInit, OnDestroy { private async selectQuizAsExisting(quizname): Promise { const currentQuiz = await this.storageService.read(DB_TABLE.QUIZ, quizname).toPromise(); const questionGroupInstance = questionGroupReflection[currentQuiz.TYPE](currentQuiz); + this.canAddQuiz = false; this.canEditQuiz = true; this.canStartQuiz = !this.settingsService.serverSettings.createQuizPasswordRequired && questionGroupInstance.isValid();