Newer
Older
import { Component, OnInit } from '@angular/core';
import { HeaderService } from '../service/header.service';
import { AppService } from '../service/app.service';
import { environment } from '../environments/environment';
import {catchError, tap} from 'rxjs/operators';
import {HttpClient} from '@angular/common/http';
import {of} from 'rxjs/internal/observable/of';
import {NotificationService} from '../service/notification/notification.service';
templateUrl: 'about-us.component.html',
styleUrls: ['about-us.component.css']
export class AboutUsComponent implements OnInit {
applicationVersion: string;
lang: any = LANG;
loading: boolean = false;
commitHash: string = this.lang.undefined;
public http: HttpClient,
private notify: NotificationService,
private headerService: HeaderService,
public appService: AppService) { }
async ngOnInit() {
this.applicationVersion = environment.VERSION;
await this.loadCommitInformation();
}
loadCommitInformation() {
return new Promise((resolve) => {
this.http.get('../rest/commitInformation').pipe(
tap((data: any) => {
this.commitHash = data.hash !== null ? data.hash : this.lang.undefined;
console.log(data);
resolve(true);
}),
catchError((err: any) => {
this.notify.handleSoftErrors(err);
return of(false);
})
).subscribe();
});