mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
Hide hidden fields on hide/minimize
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
import { Component } from '@angular/core';
|
||||
import {
|
||||
Component,
|
||||
OnInit,
|
||||
NgZone,
|
||||
} from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
import { ApiService } from 'jslib/abstractions/api.service';
|
||||
@@ -9,18 +13,41 @@ import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration
|
||||
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||
import { StateService } from 'jslib/abstractions/state.service';
|
||||
|
||||
import { BroadcasterService } from 'jslib/angular/services/broadcaster.service';
|
||||
|
||||
import { RegisterComponent as BaseRegisterComponent } from 'jslib/angular/components/register.component';
|
||||
|
||||
const BroadcasterSubscriptionId = 'RegisterComponent';
|
||||
|
||||
@Component({
|
||||
selector: 'app-register',
|
||||
templateUrl: 'register.component.html',
|
||||
})
|
||||
export class RegisterComponent extends BaseRegisterComponent {
|
||||
export class RegisterComponent extends BaseRegisterComponent implements OnInit {
|
||||
constructor(authService: AuthService, router: Router,
|
||||
i18nService: I18nService, cryptoService: CryptoService,
|
||||
apiService: ApiService, stateService: StateService,
|
||||
platformUtilsService: PlatformUtilsService, passwordGenerationService: PasswordGenerationService) {
|
||||
platformUtilsService: PlatformUtilsService, passwordGenerationService: PasswordGenerationService,
|
||||
private broadcasterService: BroadcasterService, private ngZone: NgZone) {
|
||||
super(authService, router, i18nService, cryptoService, apiService, stateService, platformUtilsService,
|
||||
passwordGenerationService);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user