summaryrefslogtreecommitdiffstats
path: root/portal-FE-common/src/app/shared/services/userbar/userbar.service.ts
blob: de42ce361b7899e317bc66413db468296516a2d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { environment } from 'src/environments/environment';

@Injectable({
  providedIn: 'root'
})
export class UserbarService {
  refreshCount: number;
  maxCount: number;
  apiUrl = environment.api;
  constructor(public http: HttpClient) {
    this.refreshCount = 0;
    this.maxCount = 0;
  }

  getRefreshCount() {
    return this.refreshCount;
  }
  setRefreshCount(count) {
    this.refreshCount = count;
  }
  setMaxRefreshCount(count) {
    this.maxCount = count;
  }
  decrementRefreshCount() {
    this.refreshCount = this.refreshCount - 1;
  }

  getOnlineUserUpdateRate(){
    return this.http.get(this.apiUrl.onlineUserUpdateRate);
  }
}