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:
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user