GitLab wurde erfolgreich aktualisiert. Durch regelmäßige Updates bleibt das THM GitLab sicher. Danke für Ihre Geduld.

Fixes styling bugs and removes the nickname in the home component during quiz cleanup

parent cc9642d1
...@@ -503,6 +503,7 @@ export class HomeComponent implements OnInit, OnDestroy { ...@@ -503,6 +503,7 @@ export class HomeComponent implements OnInit, OnDestroy {
this.connectionService.cleanUp(); this.connectionService.cleanUp();
sessionStorage.removeItem(StorageKey.CurrentQuizName); sessionStorage.removeItem(StorageKey.CurrentQuizName);
sessionStorage.removeItem(StorageKey.CurrentNickName); sessionStorage.removeItem(StorageKey.CurrentNickName);
sessionStorage.removeItem(StorageKey.QuizToken);
if (isPlatformBrowser(this.platformId)) { if (isPlatformBrowser(this.platformId)) {
this.storageService.db.Config.delete(StorageKey.QuizTheme); this.storageService.db.Config.delete(StorageKey.QuizTheme);
} }
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
<h4 class="text-center mb-5 mt-sm-5">{{'component.login.title' | translate}}</h4> <h4 class="text-center mb-5 mt-sm-5">{{'component.login.title' | translate}}</h4>
<div *ngIf="hasUsernamePasswordLogin" <div *ngIf="hasUsernamePasswordLogin"
class="input-group input-group-sm"> class="input-group">
<input (keydown.enter)="login()" <input (keydown.enter)="login()"
[(ngModel)]="username" [(ngModel)]="username"
[placeholder]="'component.login.username' | translate" [placeholder]="'component.login.username' | translate"
class="form-control" class="form-control my-2 my-sm-0"
name="username" name="username"
type="text"/> type="text"/>
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<h6 *ngIf="hasMultipleLoginMethods" <h6 *ngIf="hasMultipleLoginMethods"
class="mt-5">{{'component.login.login-via-token' | translate}}</h6> class="mt-5">{{'component.login.login-via-token' | translate}}</h6>
<div class="input-group input-group-sm"> <div class="input-group">
<input (keydown.enter)="login()" <input (keydown.enter)="login()"
[(ngModel)]="token" [(ngModel)]="token"
......
...@@ -17,8 +17,7 @@ ...@@ -17,8 +17,7 @@
button, button,
input[type="text"], input[type="text"],
input[type="password"] { input[type="password"] {
border-radius: 0.25rem;
width: 100%; width: 100%;
} }
} }
} }
\ No newline at end of file
...@@ -17,12 +17,7 @@ export class LeaderboardApiService { ...@@ -17,12 +17,7 @@ export class LeaderboardApiService {
} }
public getLeaderboardData(quizName: string, amount: number, questionIndex?: number): Observable<IMessage> { public getLeaderboardData(quizName: string, amount: number, questionIndex?: number): Observable<IMessage> {
const headers: { [key: string]: string } = {}; return this.http.get<IMessage>(this.LEADERBOARD_GET_DATA_URL(quizName, amount, questionIndex),
if (sessionStorage.getItem(StorageKey.QuizToken)) { { headers: { authorization: sessionStorage.getItem(StorageKey.QuizToken) || sessionStorage.getItem(StorageKey.PrivateKey) } });
headers.authorization = sessionStorage.getItem(StorageKey.QuizToken);
} else {
headers.authorization = sessionStorage.getItem(StorageKey.PrivateKey);
}
return this.http.get<IMessage>(this.LEADERBOARD_GET_DATA_URL(quizName, amount, questionIndex), { headers });
} }
} }
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