From 3da68324650a42013226236a1f99e059cff13b0c Mon Sep 17 00:00:00 2001 From: leejinho Date: Wed, 1 Apr 2020 15:14:45 +0900 Subject: [PATCH] =?UTF-8?q?=ED=85=8C=EB=A7=88=20=EC=84=A4=EC=A0=95?= =?UTF-8?q?=EC=9D=B4=20=EC=9E=88=EC=9D=84=20=EA=B2=BD=EC=9A=B0=20=ED=85=8C?= =?UTF-8?q?=EB=A7=88=EC=A0=81=EC=9A=A9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/main.page.component.ts | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.ts b/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.ts index 3e91d267..56a8e74e 100644 --- a/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.ts +++ b/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.ts @@ -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( KEY_ENVIRONMENTS_INFO ); + const appUserInfo = this.localStorageService.encGet( + 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(() => {