From fb63dbd142586ccec7b8640c421ba508e8fd648e Mon Sep 17 00:00:00 2001 From: Christopher Fullarton Date: Fri, 29 Nov 2019 07:56:56 +0100 Subject: [PATCH] Fixes styling bugs and removes the nickname in the home component during quiz cleanup --- src/app/root/home/home.component.ts | 1 + src/app/root/login/login.component.html | 6 +++--- src/app/root/login/login.component.scss | 3 +-- .../service/api/leaderboard/leaderboard-api.service.ts | 9 ++------- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/app/root/home/home.component.ts b/src/app/root/home/home.component.ts index 6af594fc..0f41bfc8 100644 --- a/src/app/root/home/home.component.ts +++ b/src/app/root/home/home.component.ts @@ -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); } diff --git a/src/app/root/login/login.component.html b/src/app/root/login/login.component.html index b441c24d..b8be68fa 100644 --- a/src/app/root/login/login.component.html +++ b/src/app/root/login/login.component.html @@ -2,12 +2,12 @@

{{'component.login.title' | translate}}

+ class="input-group"> @@ -32,7 +32,7 @@
{{'component.login.login-via-token' | translate}}
-
+
{ - 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(this.LEADERBOARD_GET_DATA_URL(quizName, amount, questionIndex), { headers }); + return this.http.get(this.LEADERBOARD_GET_DATA_URL(quizName, amount, questionIndex), + { headers: { authorization: sessionStorage.getItem(StorageKey.QuizToken) || sessionStorage.getItem(StorageKey.PrivateKey) } }); } } -- GitLab