ing
This commit is contained in:
parent
fd369d3519
commit
8334673ecb
|
@ -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<Member>();
|
||||
domainMember: DomainMember;
|
||||
totp;
|
||||
// @Output() regist = new EventEmitter<{ member: Member, code: string, secretCode: string }>();
|
||||
// @Output() create = new EventEmitter<Member>();
|
||||
|
||||
pending$: Observable<boolean>;
|
||||
error$: Observable<any>;
|
||||
|
||||
selectedItem: any;
|
||||
totpSettingDisplay = false;
|
||||
|
@ -20,9 +28,16 @@ export class MemberTotpComponent implements OnInit {
|
|||
|
||||
lists = [];
|
||||
|
||||
constructor() { }
|
||||
constructor(
|
||||
private store: Store<any>,
|
||||
) { }
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user