2022-10-16 00:13:03 +02:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
import { AuthService } from './services/auth/auth.service';
|
2022-10-16 01:55:20 +02:00
|
|
|
import { SocketService } from './services/socket/socket.service';
|
2022-10-16 00:13:03 +02:00
|
|
|
import { ThemeService } from './services/theme/theme.service';
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-root',
|
|
|
|
templateUrl: './app.component.html',
|
|
|
|
styleUrls: ['./app.component.scss']
|
|
|
|
})
|
|
|
|
export class AppComponent implements OnInit {
|
|
|
|
|
2022-10-16 12:57:27 +02:00
|
|
|
themeName!: string;
|
|
|
|
sidebarWidth!: string;
|
|
|
|
|
|
|
|
isLoggedIn: boolean = false;
|
|
|
|
|
2022-10-16 00:13:03 +02:00
|
|
|
constructor(
|
|
|
|
public authService: AuthService,
|
2022-10-16 12:57:27 +02:00
|
|
|
private themeService: ThemeService,
|
2022-10-16 01:55:20 +02:00
|
|
|
private socket: SocketService
|
2022-10-16 00:13:03 +02:00
|
|
|
) { }
|
|
|
|
|
|
|
|
ngOnInit(): void {
|
2022-10-16 12:57:27 +02:00
|
|
|
this.themeService.sidebarWidth$.subscribe(value => {
|
|
|
|
this.sidebarWidth = value;
|
|
|
|
});
|
|
|
|
this.themeService.themeName$.subscribe(value => {
|
|
|
|
this.themeName = value;
|
|
|
|
});
|
|
|
|
|
2022-10-16 01:55:20 +02:00
|
|
|
this.socket.startSocket();
|
2022-10-16 00:13:03 +02:00
|
|
|
this.themeService.loadTheme();
|
|
|
|
}
|
2022-10-16 12:57:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
setSideWidth($event: any): void {
|
|
|
|
this.themeService.setSideWidth($event);
|
|
|
|
}
|
2022-10-16 00:13:03 +02:00
|
|
|
}
|