Move some subscriptions' lifespan. Added automatic TTS login (when there's an API key)
This commit is contained in:
@ -34,12 +34,8 @@ export class TtsLoginComponent implements OnInit, OnDestroy {
|
||||
ngOnInit(): void {
|
||||
this.route.data.subscribe(d => this.api_keys = d['keys']);
|
||||
|
||||
this.subscriptions.push(this.events.listen('tts_login_ack', async _ => {
|
||||
await this.router.navigate(['policies'])
|
||||
}));
|
||||
this.subscriptions.push(this.events.listen('tts_logoff', async _ => {
|
||||
this.selected_api_key = undefined;
|
||||
await this.router.navigate(['tts-login'])
|
||||
}));
|
||||
this.subscriptions.push(this.events.listen('impersonation', _ => {
|
||||
this.selected_api_key = undefined;
|
||||
@ -51,8 +47,7 @@ export class TtsLoginComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
if (!this.hermes.logged_in)
|
||||
this.subscriptions.forEach(s => s.unsubscribe());
|
||||
this.subscriptions.forEach(s => s.unsubscribe());
|
||||
}
|
||||
|
||||
login() {
|
||||
|
Reference in New Issue
Block a user