blob: e2551f7a5223ab19b4740bfd2abc6da1ce5aab25 (
plain) (
blame)
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
34
35
36
37
38
39
|
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { Location } from '@angular/common';
import { AuthService } from '../../_services/auth.service';
import shared from 'src/app/Shared';
import { UserInfoService } from 'src/app/_services/user-info.service';
import { MatDialog } from '@angular/material/dialog';
@Component({
selector: 'app-navbar',
templateUrl: './navbar.component.html',
styleUrls: ['./navbar.component.css'],
encapsulation: ViewEncapsulation.Emulated
})
export class NavbarComponent implements OnInit {
currentUrl: string;
shared = shared;
constructor(public location: Location, private auth: AuthService, private userInfoService: UserInfoService, private matDialog: MatDialog) {
shared.dialog = matDialog;
this.currentUrl = this.location.path();
this.location.onUrlChange(() => {
this.currentUrl = this.location.path();
})
}
ngOnInit(): void {
this.auth.updateUser();
if (this.auth.isAuthenticated() != false) {
this.userInfoService.getUserInfo().subscribe((response) => {
shared.photoId = response.photoId;
});
}
}
logOut() {
this.auth.logOut();
}
}
|