rdt-client/client/src/app/navbar/navbar.component.ts
Roger Far fa11dc9bc7 Big update on the add download and setting screens which are now proper pages instead of modals.
Fixed issue where it would slow down on waiting for RealDebrid generating links for downloads.
2021-07-18 17:29:45 -06:00

33 lines
890 B
TypeScript

import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { AuthService } from '../auth.service';
import { Profile } from '../models/profile.model';
import { SettingsService } from '../settings.service';
@Component({
selector: 'app-navbar',
templateUrl: './navbar.component.html',
styleUrls: ['./navbar.component.scss'],
})
export class NavbarComponent implements OnInit {
public showMobileMenu = false;
public profile: Profile;
constructor(private settingsService: SettingsService, private authService: AuthService, private router: Router) {}
ngOnInit(): void {
this.settingsService.getProfile().subscribe((result) => {
this.profile = result;
});
}
public logout(): void {
this.authService.logout().subscribe(
() => {
this.router.navigate(['/login']);
},
(err) => {}
);
}
}