테마 설정이 있을 경우 테마적용.
This commit is contained in:
parent
4e4aba38da
commit
3da6832465
|
@ -6,7 +6,8 @@ import {
|
|||
OnDestroy,
|
||||
ViewChild,
|
||||
NgZone,
|
||||
ElementRef
|
||||
ElementRef,
|
||||
Renderer2
|
||||
} from '@angular/core';
|
||||
|
||||
import { Store, select } from '@ngrx/store';
|
||||
|
@ -64,7 +65,7 @@ import { environment } from '../../../../environments/environment';
|
|||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { LeftSideComponent } from '@app/layouts/messenger/components/left-side.component';
|
||||
import { MatDrawer } from '@angular/material/sidenav';
|
||||
import { LocationStrategy } from '@angular/common';
|
||||
import { LocationStrategy, DOCUMENT } from '@angular/common';
|
||||
import { ElectronBrowserWindowChannel } from '@ucap-webmessenger/electron-core';
|
||||
|
||||
@Component({
|
||||
|
@ -118,12 +119,27 @@ export class MainPageComponent implements OnInit, OnDestroy {
|
|||
private translateService: TranslateService,
|
||||
private dialogService: DialogService,
|
||||
private location: LocationStrategy,
|
||||
@Inject(DOCUMENT) private document: Document,
|
||||
private renderer2: Renderer2,
|
||||
private logger: NGXLogger
|
||||
) {
|
||||
this.environmentsInfo = this.sessionStorageService.get<EnvironmentsInfo>(
|
||||
KEY_ENVIRONMENTS_INFO
|
||||
);
|
||||
|
||||
const appUserInfo = this.localStorageService.encGet<AppUserInfo>(
|
||||
KEY_APP_USER_INFO,
|
||||
environment.customConfig.appKey
|
||||
);
|
||||
|
||||
if (!!appUserInfo && !!appUserInfo.settings.general.appTheme) {
|
||||
this.renderer2.setAttribute(
|
||||
this.document.body,
|
||||
'class',
|
||||
appUserInfo.settings.general.appTheme
|
||||
);
|
||||
}
|
||||
|
||||
// preventing back button in browser
|
||||
history.pushState(null, null, window.location.href);
|
||||
this.location.onPopState(() => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user