mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
Use typescript standard and lint all files
This commit is contained in:
parent
46757b477c
commit
df98563e21
143 changed files with 2016 additions and 1949 deletions
|
@ -1,8 +1,8 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { Component, OnInit } from '@angular/core'
|
||||
import { Router } from '@angular/router'
|
||||
|
||||
import { AuthService, AuthStatus } from '../auth';
|
||||
import { ConfigService } from '../config';
|
||||
import { AuthService, AuthStatus } from '../auth'
|
||||
import { ConfigService } from '../config'
|
||||
|
||||
@Component({
|
||||
selector: 'my-menu',
|
||||
|
@ -10,7 +10,7 @@ import { ConfigService } from '../config';
|
|||
styleUrls: [ './menu.component.scss' ]
|
||||
})
|
||||
export class MenuComponent implements OnInit {
|
||||
isLoggedIn: boolean;
|
||||
isLoggedIn: boolean
|
||||
|
||||
constructor (
|
||||
private authService: AuthService,
|
||||
|
@ -18,35 +18,35 @@ export class MenuComponent implements OnInit {
|
|||
private router: Router
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.isLoggedIn = this.authService.isLoggedIn();
|
||||
ngOnInit () {
|
||||
this.isLoggedIn = this.authService.isLoggedIn()
|
||||
|
||||
this.authService.loginChangedSource.subscribe(
|
||||
status => {
|
||||
if (status === AuthStatus.LoggedIn) {
|
||||
this.isLoggedIn = true;
|
||||
console.log('Logged in.');
|
||||
this.isLoggedIn = true
|
||||
console.log('Logged in.')
|
||||
} else if (status === AuthStatus.LoggedOut) {
|
||||
this.isLoggedIn = false;
|
||||
console.log('Logged out.');
|
||||
this.isLoggedIn = false
|
||||
console.log('Logged out.')
|
||||
} else {
|
||||
console.error('Unknown auth status: ' + status);
|
||||
console.error('Unknown auth status: ' + status)
|
||||
}
|
||||
}
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
isRegistrationEnabled() {
|
||||
return this.configService.getConfig().signup.enabled;
|
||||
isRegistrationEnabled () {
|
||||
return this.configService.getConfig().signup.enabled
|
||||
}
|
||||
|
||||
isUserAdmin() {
|
||||
return this.authService.isAdmin();
|
||||
isUserAdmin () {
|
||||
return this.authService.isAdmin()
|
||||
}
|
||||
|
||||
logout() {
|
||||
this.authService.logout();
|
||||
logout () {
|
||||
this.authService.logout()
|
||||
// Redirect to home page
|
||||
this.router.navigate(['/videos/list']);
|
||||
this.router.navigate(['/videos/list'])
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue