From 8334673ecbdf9cd6264909110db5ae94d07793d4 Mon Sep 17 00:00:00 2001 From: geek Date: Fri, 1 Jun 2018 20:31:46 +0900 Subject: [PATCH] ing --- .../member/component/member-totp.component.ts | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/@overflow/member/component/member-totp.component.ts b/@overflow/member/component/member-totp.component.ts index a488d22..2a3d4f3 100644 --- a/@overflow/member/component/member-totp.component.ts +++ b/@overflow/member/component/member-totp.component.ts @@ -1,16 +1,24 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { DomainMember } from '@overflow/commons-typescript/model/domain'; import { Member } from '@overflow/commons-typescript/model/member'; +import {AuthSelector} from '../../shared/auth/store'; +import { Observable, of } from 'rxjs'; +import { Store } from '@ngrx/store'; +import * as AuthStore from '@overflow/shared/auth/store/auth'; +import { catchError, map, tap } from 'rxjs/operators'; @Component({ selector: 'of-member-totp', templateUrl: './member-totp.component.html', }) export class MemberTotpComponent implements OnInit { - @Input() domainMember: DomainMember; - @Input() totp; - @Output() regist = new EventEmitter<{ member: Member, code: string, secretCode: string }>(); - @Output() create = new EventEmitter(); + domainMember: DomainMember; + totp; + // @Output() regist = new EventEmitter<{ member: Member, code: string, secretCode: string }>(); + // @Output() create = new EventEmitter(); + + pending$: Observable; + error$: Observable; selectedItem: any; totpSettingDisplay = false; @@ -20,9 +28,16 @@ export class MemberTotpComponent implements OnInit { lists = []; - constructor() { } + constructor( + private store: Store, + ) { } ngOnInit() { + this.store.select(AuthSelector.selectDomainMember).subscribe( + (domainMember: DomainMember) => { + this.domainMember = domainMember; + } + ); this.lists = [ { id: 1, name: 'Email', value: this.domainMember.member.email, description: 'blabla', }, { id: 2, name: 'Phone', value: this.domainMember.member.phone, description: 'blabla', }, @@ -43,7 +58,7 @@ export class MemberTotpComponent implements OnInit { totpInput(e) { if (e.target.value.length >= 6) { - this.regist.emit(e.target.value); + // this.regist.emit(e.target.value); } return; }