This commit is contained in:
crusader 2018-10-18 17:51:39 +09:00
parent f1c4eda652
commit b2e745d049
2 changed files with 9 additions and 22 deletions

View File

@ -1,4 +1,4 @@
<p-blockUI [blocked]="block"></p-blockUI>
<p-blockUI [blocked]="blockAppContent$ | async"></p-blockUI>
<div id="app-container">
<div id="app-chrome" class="focused">

View File

@ -9,7 +9,8 @@ import { TranslateService } from '@ngx-translate/core';
import { ElectronProxyService } from './service/electron-proxy.service';
import { MenuEvent } from '../commons/type';
import * as AppStore from './store/app';
import * as AppStore from './store';
import * as _AppStore from './store/app';
import * as UserStore from './store/environment/user';
import * as log from './core/util/log';
@ -22,7 +23,6 @@ import * as log from './core/util/log';
export class AppComponent implements OnInit, AfterContentInit, AfterViewInit, OnDestroy {
title = 'scanner-app';
showTitleBar: boolean;
block: boolean;
menuSubscription: Subscription;
displayAbout: boolean;
@ -32,6 +32,8 @@ export class AppComponent implements OnInit, AfterContentInit, AfterViewInit, On
displayPreferences: boolean;
displayPrint: boolean;
blockAppContent$ = this.store.pipe(select(AppStore.UISelector.LayoutSelector.selectBlockAppContent));
public constructor(
private changeDetector: ChangeDetectorRef,
private store: Store<any>,
@ -40,24 +42,9 @@ export class AppComponent implements OnInit, AfterContentInit, AfterViewInit, On
) {
// this.showTitleBar = !__LINUX__;
this.showTitleBar = false;
this.block = false;
this.translateService.addLangs(['en', 'ko']);
this.translateService.setDefaultLang('en');
// this.translateService.onLangChange.subscribe((e) => {
// this.changeDetector.markForCheck();
// });
// this.translateService.onTranslationChange.subscribe((e) => {
// this.changeDetector.detectChanges();
// });
// const i18ns = ['en', 'ko'];
// i18ns.forEach((lang) => {
// this.translateService.use(lang);
// });
}
ngOnInit(): void {
@ -69,7 +56,7 @@ export class AppComponent implements OnInit, AfterContentInit, AfterViewInit, On
__this.changeDetector.detectChanges();
});
this.store.dispatch(new AppStore.AppInit());
this.store.dispatch(new _AppStore.AppInit());
this.store.dispatch(new UserStore.SetMemberID({ memberID: 'scannerUser' }));
// this.probeService.connect();
this.electronProxyService.sendReady(performance.now());
@ -124,17 +111,17 @@ export class AppComponent implements OnInit, AfterContentInit, AfterViewInit, On
}
ngAfterContentInit(): void {
this.store.dispatch(new AppStore.AppAfterContentInit());
this.store.dispatch(new _AppStore.AppAfterContentInit());
}
ngAfterViewInit(): void {
this.store.dispatch(new AppStore.AppAfterViewInit());
this.store.dispatch(new _AppStore.AppAfterViewInit());
}
ngOnDestroy(): void {
this.store.dispatch(new AppStore.AppDestroy());
this.store.dispatch(new _AppStore.AppDestroy());
this.menuSubscription.unsubscribe();
}