|
@@ -75,7 +75,6 @@ export class AppComponent extends BaseComponent implements OnInit {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ngOnInit(): void {
|
|
ngOnInit(): void {
|
|
|
- this.setDefaultTheme();
|
|
|
|
|
this.router.events.pipe(untilDestroy(this),
|
|
this.router.events.pipe(untilDestroy(this),
|
|
|
filter((event) => event instanceof RoutesRecognized),
|
|
filter((event) => event instanceof RoutesRecognized),
|
|
|
map((res:any) => {
|
|
map((res:any) => {
|
|
@@ -111,27 +110,6 @@ export class AppComponent extends BaseComponent implements OnInit {
|
|
|
this.store.dispatch(new ChangeLanguage(language));
|
|
this.store.dispatch(new ChangeLanguage(language));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- protected setDefaultTheme() {
|
|
|
|
|
- if (localStorage.getItem('theme')) {
|
|
|
|
|
- this.theme = localStorage.getItem('theme') as string;
|
|
|
|
|
- const body = document.getElementsByTagName('body')[0];
|
|
|
|
|
- body.classList.add(this.theme);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * change application theme
|
|
|
|
|
- * @param {string} theme theme name
|
|
|
|
|
- */
|
|
|
|
|
- protected changeTheme(theme: string) {
|
|
|
|
|
- const body = document.getElementsByTagName('body')[0];
|
|
|
|
|
- body.classList.remove(this.theme);
|
|
|
|
|
- this.theme = theme;
|
|
|
|
|
- body.classList.add(this.theme);
|
|
|
|
|
- localStorage.setItem('theme',this.theme);
|
|
|
|
|
- this.store.dispatch(new ChangeTheme(this.theme));
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
protected addNotification() {
|
|
protected addNotification() {
|
|
|
this.store.dispatch(new Notification.Add({
|
|
this.store.dispatch(new Notification.Add({
|
|
|
message:{title:generateId(),desc:generateId(),timestamp: new Date()}
|
|
message:{title:generateId(),desc:generateId(),timestamp: new Date()}
|