bitwarden-estensione-browser/src/app/accounts/register.component.ts

53 lines
2.0 KiB
TypeScript
Raw Normal View History

2020-11-04 18:09:21 +01:00
import {
Component,
OnInit,
NgZone,
} from '@angular/core';
2018-01-31 20:19:21 +01:00
import { Router } from '@angular/router';
import { ApiService } from 'jslib/abstractions/api.service';
import { AuthService } from 'jslib/abstractions/auth.service';
import { CryptoService } from 'jslib/abstractions/crypto.service';
import { I18nService } from 'jslib/abstractions/i18n.service';
import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';
2018-10-02 15:22:40 +02:00
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
2018-07-13 17:07:49 +02:00
import { StateService } from 'jslib/abstractions/state.service';
2018-01-31 20:19:21 +01:00
2020-11-04 18:09:21 +01:00
import { BroadcasterService } from 'jslib/angular/services/broadcaster.service';
2018-04-04 15:47:49 +02:00
import { RegisterComponent as BaseRegisterComponent } from 'jslib/angular/components/register.component';
2020-11-04 18:09:21 +01:00
const BroadcasterSubscriptionId = 'RegisterComponent';
2018-01-31 20:19:21 +01:00
@Component({
selector: 'app-register',
templateUrl: 'register.component.html',
2018-01-31 20:19:21 +01:00
})
2020-11-04 18:09:21 +01:00
export class RegisterComponent extends BaseRegisterComponent implements OnInit {
2018-04-04 15:47:49 +02:00
constructor(authService: AuthService, router: Router,
i18nService: I18nService, cryptoService: CryptoService,
2018-10-02 15:22:40 +02:00
apiService: ApiService, stateService: StateService,
2020-11-04 18:09:21 +01:00
platformUtilsService: PlatformUtilsService, passwordGenerationService: PasswordGenerationService,
private broadcasterService: BroadcasterService, private ngZone: NgZone) {
super(authService, router, i18nService, cryptoService, apiService, stateService, platformUtilsService,
passwordGenerationService);
}
2020-11-04 18:09:21 +01:00
async ngOnInit() {
this.broadcasterService.subscribe(BroadcasterSubscriptionId, async (message: any) => {
this.ngZone.run(() => {
switch (message.command) {
case 'windowHidden':
this.onWindowHidden();
break;
default:
}
});
});
}
onWindowHidden() {
this.showPassword = false;
}
2018-01-31 20:19:21 +01:00
}