1
0
mirror of https://github.com/bitwarden/desktop.git synced 2024-09-27 03:53:00 +02:00
bitwarden-desktop/src/app/accounts/register.component.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

74 lines
2.3 KiB
TypeScript
Raw Permalink Normal View History

2020-11-04 18:09:21 +01:00
import { Component, NgZone, OnDestroy, OnInit } from "@angular/core";
2018-01-31 20:19:21 +01:00
import { Router } from "@angular/router";
2021-12-20 15:47:17 +01:00
2022-02-24 20:50:19 +01:00
import { RegisterComponent as BaseRegisterComponent } from "jslib-angular/components/register.component";
import { ApiService } from "jslib-common/abstractions/api.service";
import { AuthService } from "jslib-common/abstractions/auth.service";
2021-12-06 12:03:02 +01:00
import { BroadcasterService } from "jslib-common/abstractions/broadcaster.service";
import { CryptoService } from "jslib-common/abstractions/crypto.service";
import { EnvironmentService } from "jslib-common/abstractions/environment.service";
import { I18nService } from "jslib-common/abstractions/i18n.service";
import { LogService } from "jslib-common/abstractions/log.service";
import { PasswordGenerationService } from "jslib-common/abstractions/passwordGeneration.service";
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
import { StateService } from "jslib-common/abstractions/state.service";
2021-12-20 15:47:17 +01:00
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
})
export class RegisterComponent extends BaseRegisterComponent implements OnInit, OnDestroy {
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,
environmentService: EnvironmentService,
private broadcasterService: BroadcasterService,
private ngZone: NgZone,
logService: LogService
) {
super(
authService,
router,
i18nService,
cryptoService,
apiService,
stateService,
platformUtilsService,
passwordGenerationService,
environmentService,
logService
);
}
2021-12-20 15:47:17 +01:00
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:
}
});
2021-12-20 15:47:17 +01:00
});
super.ngOnInit();
2020-11-04 18:09:21 +01:00
}
2021-12-20 15:47:17 +01:00
ngOnDestroy() {
this.broadcasterService.unsubscribe(BroadcasterSubscriptionId);
}
2021-12-20 15:47:17 +01:00
2020-11-04 18:09:21 +01:00
onWindowHidden() {
this.showPassword = false;
}
2018-01-31 20:19:21 +01:00
}