leejinho fd5b4b12f3 로그아웃, 설정 버튼에 대한 유효성 체크.
1. 로그아웃시 보여지지 않게 수정.
2. 로그인 상태가 아닐 경우에 skip 하도록 수정.
3. 로그아웃시 confirm 하도록 수정.
2019-11-25 10:47:44 +09:00

29 lines
914 B
TypeScript

import { Injectable, Inject } from '@angular/core';
import { UCAP_NATIVE_SERVICE, NativeService } from '@ucap-webmessenger/native';
import { Store } from '@ngrx/store';
import { NGXLogger } from 'ngx-logger';
import * as AuthenticationStore from '@app/store/account/authentication';
import * as SettingsStore from '@app/store/messenger/settings';
@Injectable({
providedIn: 'root'
})
export class AppNativeService {
constructor(
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService,
private store: Store<any>,
private logger: NGXLogger
) {}
subscribe(): void {
this.nativeService.logout().subscribe(() => {
this.store.dispatch(AuthenticationStore.logoutConfirmation());
});
this.nativeService.changeStatus().subscribe(statusCode => {});
this.nativeService.showSetting().subscribe(() => {
this.store.dispatch(SettingsStore.showDialog());
});
}
}