2020-11-04 18:09:21 +01:00
|
|
|
import {
|
|
|
|
Component,
|
2021-02-03 19:21:22 +01:00
|
|
|
NgZone,
|
2020-11-04 20:00:44 +01:00
|
|
|
OnDestroy,
|
2020-11-04 18:09:21 +01:00
|
|
|
OnInit,
|
|
|
|
} from '@angular/core';
|
2018-01-31 20:19:21 +01:00
|
|
|
import { Router } from '@angular/router';
|
|
|
|
|
2021-06-07 19:26:36 +02:00
|
|
|
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';
|
2021-06-07 19:26:36 +02:00
|
|
|
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
2021-07-23 20:48:10 +02:00
|
|
|
import { EnvironmentService } from 'jslib-common/abstractions/environment.service';
|
2021-06-07 19:26:36 +02:00
|
|
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
2021-10-21 11:10:36 +02:00
|
|
|
import { LogService } from 'jslib-common/abstractions/log.service';
|
2021-06-07 19:26:36 +02:00
|
|
|
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
|
|
|
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
|
|
|
import { StateService } from 'jslib-common/abstractions/state.service';
|
2018-01-31 20:19:21 +01:00
|
|
|
|
2021-06-07 19:26:36 +02:00
|
|
|
import { RegisterComponent as BaseRegisterComponent } from 'jslib-angular/components/register.component';
|
2018-04-04 15:47:49 +02:00
|
|
|
|
2020-11-04 18:09:21 +01:00
|
|
|
const BroadcasterSubscriptionId = 'RegisterComponent';
|
|
|
|
|
2018-01-31 20:19:21 +01:00
|
|
|
@Component({
|
|
|
|
selector: 'app-register',
|
2018-04-06 18:25:22 +02:00
|
|
|
templateUrl: 'register.component.html',
|
2018-01-31 20:19:21 +01:00
|
|
|
})
|
2020-11-04 20:00:44 +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,
|
2021-07-23 20:48:10 +02:00
|
|
|
environmentService: EnvironmentService, private broadcasterService: BroadcasterService,
|
2021-10-21 11:10:36 +02:00
|
|
|
private ngZone: NgZone, logService: LogService) {
|
2018-11-15 21:13:47 +01:00
|
|
|
super(authService, router, i18nService, cryptoService, apiService, stateService, platformUtilsService,
|
2021-10-21 11:10:36 +02:00
|
|
|
passwordGenerationService, environmentService, logService);
|
2018-11-15 21:13:47 +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-07-23 20:48:10 +02:00
|
|
|
|
|
|
|
super.ngOnInit();
|
2020-11-04 18:09:21 +01:00
|
|
|
}
|
|
|
|
|
2020-11-04 20:00:44 +01:00
|
|
|
ngOnDestroy() {
|
|
|
|
this.broadcasterService.unsubscribe(BroadcasterSubscriptionId);
|
|
|
|
}
|
|
|
|
|
2020-11-04 18:09:21 +01:00
|
|
|
onWindowHidden() {
|
|
|
|
this.showPassword = false;
|
|
|
|
}
|
2018-01-31 20:19:21 +01:00
|
|
|
}
|