Skip to content

Commit

Permalink
Move backend call into onInit to ensure only called once
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanc19 committed Jan 9, 2025
1 parent 065f562 commit ccf5b49
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { Component, OnDestroy } from '@angular/core';
import { Component, OnDestroy, OnInit } from '@angular/core';
import { UserService } from '@core/services/user.service';
import { Subscription } from 'rxjs';

@Component({
selector: 'app-vacancies-and-turnover-login-message',
templateUrl: './vacancies-and-turnover-login-message.component.html',
})
export class VacanciesAndTurnoverLoginMessage implements OnDestroy {
export class VacanciesAndTurnoverLoginMessage implements OnInit, OnDestroy {
private subscriptions: Subscription = new Subscription();

constructor(private userService: UserService) {
constructor(private userService: UserService) {}

ngOnInit(): void {
this.subscriptions.add(this.userService.updateLastViewedVacanciesAndTurnoverMessage().subscribe(() => {}));
}

Expand Down

0 comments on commit ccf5b49

Please sign in to comment.