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

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