2018-06-21 23:14:36 +02:00
|
|
|
import {
|
|
|
|
Component,
|
|
|
|
ComponentFactoryResolver,
|
|
|
|
ViewChild,
|
|
|
|
ViewContainerRef,
|
|
|
|
} from '@angular/core';
|
|
|
|
|
|
|
|
import { ModalComponent } from '../modal.component';
|
|
|
|
import { DeauthorizeSessionsComponent } from './deauthorize-sessions.component';
|
2018-06-21 05:35:40 +02:00
|
|
|
|
2018-06-21 04:27:37 +02:00
|
|
|
@Component({
|
|
|
|
selector: 'app-account',
|
|
|
|
templateUrl: 'account.component.html',
|
|
|
|
})
|
2018-06-21 21:57:28 +02:00
|
|
|
export class AccountComponent {
|
2018-06-21 23:14:36 +02:00
|
|
|
@ViewChild('deauthorizeSessionsTemplate', { read: ViewContainerRef }) deauthModalRef: ViewContainerRef;
|
|
|
|
|
|
|
|
private modal: ModalComponent = null;
|
|
|
|
|
|
|
|
constructor(private componentFactoryResolver: ComponentFactoryResolver) { }
|
|
|
|
|
2018-06-21 21:57:28 +02:00
|
|
|
deauthorizeSessions() {
|
2018-06-21 23:14:36 +02:00
|
|
|
if (this.modal != null) {
|
|
|
|
this.modal.close();
|
|
|
|
}
|
|
|
|
|
|
|
|
const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
|
|
|
|
this.modal = this.deauthModalRef.createComponent(factory).instance;
|
|
|
|
this.modal.show<DeauthorizeSessionsComponent>(DeauthorizeSessionsComponent, this.deauthModalRef);
|
2018-06-21 21:57:28 +02:00
|
|
|
|
2018-06-21 23:14:36 +02:00
|
|
|
this.modal.onClosed.subscribe(async () => {
|
|
|
|
this.modal = null;
|
|
|
|
});
|
2018-06-21 21:57:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
purgeVault() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
deleteAccount() {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|