GitLab steht aufgrund wichtiger Wartungsarbeiten am Montag, den 8. März, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

Bugfixes

parent 56a4576a
......@@ -25,6 +25,7 @@ export class AppDb extends Dexie {
this.Config.get(StorageKey.PrivateKey).then(privateKey => {
if (privateKey) {
sessionStorage.setItem(StorageKey.PrivateKey, privateKey.value);
this.initialized.next();
return;
}
......
......@@ -24,7 +24,7 @@
</span>
<input #enteredSessionNameInput
(focus)="showQuiznameDatalist()"
(input)="parseQuiznameInput($event)"
(ngModelChange)="parseQuiznameInput()"
[(ngModel)]="enteredSessionName"
[class.rounded-top]="showJoinableQuizzes && isShowingQuiznameDatalist"
[class.rounded]="!showJoinableQuizzes || !isShowingQuiznameDatalist"
......@@ -77,7 +77,7 @@
</div>
<div class="row no-gutters">
<div [class.col-12]="!canModifyQuiz"
[class.pr-1]="!canModifyQuiz"
[class.pr-1]="canModifyQuiz"
[class.col-6]="canModifyQuiz"
class="col-join-session pl-0">
......@@ -108,8 +108,7 @@
[class.btn-outline-secondary]="!canStartQuiz || (passwordRequired && !serverPassword.length)"
[class.btn-secondary]="canStartQuiz && (!passwordRequired || serverPassword.length)"
[disabled]="!canStartQuiz || (passwordRequired && !serverPassword.length)"
class="btn btn-success btn-block px-1"
id="startSession">
class="btn btn-success btn-block px-1">
<fa-icon *ngIf="isPerformingClick('startSession')"
[icon]="'spinner'"
[spin]="true"></fa-icon>
......
......@@ -212,12 +212,13 @@ export class HomeComponent implements OnInit, OnDestroy {
public selectQuizByList(quizName: string): void {
this.hideQuiznameDatalist();
this.selectQuizByName(quizName);
this.enteredSessionName = quizName;
this.selectQuizByName(this.enteredSessionName.trim());
}
public parseQuiznameInput(event: any): void {
public parseQuiznameInput(): void {
this.isQueryingQuizState = true;
this.selectQuizByName(event.target.value.trim());
this.selectQuizByName(this.enteredSessionName.trim());
}
public setPassword(event: Event): void {
......@@ -403,7 +404,6 @@ export class HomeComponent implements OnInit, OnDestroy {
}
private selectQuizByName(quizName: string): void {
this.enteredSessionName = quizName;
this.canJoinQuiz = false;
this.canAddQuiz = false;
this.canEditQuiz = false;
......@@ -416,7 +416,7 @@ export class HomeComponent implements OnInit, OnDestroy {
return;
}
if (this.ownQuizzes.find(quiz => quiz === quizName.toLowerCase())) {
if (this.ownQuizzes.find(quiz => quiz === quizName)) {
this.selectQuizAsExisting(quizName);
} else if (quizName.toLowerCase() === 'demo quiz') {
this.selectQuizAsDemoQuiz();
......
......@@ -19,7 +19,6 @@ export class StorageService {
public switchDb(username: string): Observable<void> {
if (this._db && this._db.name === username) {
this.stateNotifier.next(DbState.Initialized);
return this._db.initialized;
}
......
import { isPlatformBrowser, isPlatformServer } from '@angular/common';
import { EventEmitter, Inject, Injectable, PLATFORM_ID } from '@angular/core';
import { filter } from 'rxjs/operators';
import { environment } from '../../../environments/environment';
import { themes } from '../../lib/available-themes';
import { DbState, StorageKey } from '../../lib/enums/enums';
......@@ -44,10 +45,8 @@ export class ThemesService {
) {
this._defaultTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? QuizTheme.Blackbeauty : environment.availableQuizThemes[0];
this.storageService.stateNotifier.subscribe(val => {
if (val === DbState.Initialized) {
this.initTheme();
}
this.storageService.stateNotifier.pipe(filter(val => val === DbState.Initialized)).subscribe(() => {
this.initTheme();
});
}
......
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