1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 02:03:39 +00:00

Add password show/hide to reprompt (#959)

This commit is contained in:
Oscar Hinton
2021-08-27 15:30:44 +02:00
committed by GitHub
parent 5b4931e260
commit 2ba8925b81
12 changed files with 126 additions and 125 deletions

View File

@@ -1,6 +1,5 @@
import {
Component,
ComponentFactoryResolver,
NgZone,
OnDestroy,
ViewChild,
@@ -24,9 +23,9 @@ import { SyncService } from 'jslib-common/abstractions/sync.service';
import { UserService } from 'jslib-common/abstractions/user.service';
import { BroadcasterService } from 'jslib-angular/services/broadcaster.service';
import { ModalService } from 'jslib-angular/services/modal.service';
import { LoginComponent as BaseLoginComponent } from 'jslib-angular/components/login.component';
import { ModalComponent } from 'jslib-angular/components/modal.component';
const BroadcasterSubscriptionId = 'LoginComponent';
@@ -42,7 +41,7 @@ export class LoginComponent extends BaseLoginComponent implements OnDestroy {
private deferFocus: boolean = null;
constructor(authService: AuthService, router: Router, i18nService: I18nService,
syncService: SyncService, private componentFactoryResolver: ComponentFactoryResolver,
syncService: SyncService, private modalService: ModalService,
platformUtilsService: PlatformUtilsService, stateService: StateService,
environmentService: EnvironmentService, passwordGenerationService: PasswordGenerationService,
cryptoFunctionService: CryptoFunctionService, storageService: StorageService,
@@ -89,20 +88,16 @@ export class LoginComponent extends BaseLoginComponent implements OnDestroy {
this.broadcasterService.unsubscribe(BroadcasterSubscriptionId);
}
settings() {
const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
const modal = this.environmentModal.createComponent(factory).instance;
async settings() {
const [modal, childComponent] = await this.modalService.openViewRef(EnvironmentComponent, this.environmentModal);
modal.onShown.subscribe(() => {
this.showingModal = true;
});
modal.onClosed.subscribe(() => {
this.showingModal = false;
modal.onShown.unsubscribe();
modal.onClosed.unsubscribe();
});
const childComponent = modal.show<EnvironmentComponent>(EnvironmentComponent,
this.environmentModal);
childComponent.onSaved.subscribe(() => {
modal.close();
});