Skip to content

Commit

Permalink
Sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
latin-panda committed Oct 7, 2024
1 parent 6f64f8d commit 55e7058
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions webapp/src/ts/services/training-cards.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const TRAINING_PREFIX: string = 'training:';
providedIn: 'root'
})
export class TrainingCardsService {
private globalActions: GlobalActions;
private readonly globalActions: GlobalActions;
private readonly STORAGE_KEY_LAST_VIEWED_DATE = 'training-cards-last-viewed-date';

constructor(
Expand Down Expand Up @@ -111,7 +111,7 @@ export class TrainingCardsService {

this.modalService
.show(TrainingCardsComponent)
.afterOpened()
?.afterOpened()
.pipe(first())
.subscribe(() => {
window.localStorage.setItem(this.STORAGE_KEY_LAST_VIEWED_DATE, new Date().toISOString());
Expand Down Expand Up @@ -153,7 +153,7 @@ export class TrainingCardsService {
}

private hasBeenDisplayed() {
const dateString = window.localStorage.getItem(this.STORAGE_KEY_LAST_VIEWED_DATE) || '';
const dateString = window.localStorage.getItem(this.STORAGE_KEY_LAST_VIEWED_DATE) ?? '';
const lastViewedDate = new Date(dateString);

if (isNaN(lastViewedDate.getTime())) {
Expand Down

0 comments on commit 55e7058

Please sign in to comment.