sh_discord_bot/kdb-web/src/app/app.component.ts

41 lines
990 B
TypeScript
Raw Normal View History

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 {
themeName!: string;
sidebarWidth!: string;
isLoggedIn: boolean = false;
2022-10-16 00:13:03 +02:00
constructor(
public authService: AuthService,
private themeService: ThemeService,
2022-10-16 01:55:20 +02:00
private socket: SocketService
2022-10-16 00:13:03 +02:00
) { }
ngOnInit(): void {
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();
}
setSideWidth($event: any): void {
this.themeService.setSideWidth($event);
}
2022-10-16 00:13:03 +02:00
}