mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 05:43:41 +00:00
add close button to passoword history dialog (#12790)
This commit is contained in:
@@ -14,5 +14,11 @@
|
|||||||
>
|
>
|
||||||
{{ "clearHistory" | i18n }}
|
{{ "clearHistory" | i18n }}
|
||||||
</button>
|
</button>
|
||||||
|
<!-- FIXME: Remove the close button once the dialog doesn't overlap electron's
|
||||||
|
drag area.
|
||||||
|
-->
|
||||||
|
<button bitButton type="submit" buttonType="secondary" (click)="close()">
|
||||||
|
{{ "close" | i18n }}
|
||||||
|
</button>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</bit-dialog>
|
</bit-dialog>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// FIXME: Update this file to be type safe and remove this and next line
|
// FIXME: Update this file to be type safe and remove this and next line
|
||||||
// @ts-strict-ignore
|
// @ts-strict-ignore
|
||||||
|
import { DialogRef } from "@angular/cdk/dialog";
|
||||||
import { CommonModule } from "@angular/common";
|
import { CommonModule } from "@angular/common";
|
||||||
import { Component } from "@angular/core";
|
import { Component } from "@angular/core";
|
||||||
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
||||||
@@ -34,6 +35,7 @@ export class CredentialGeneratorHistoryDialogComponent {
|
|||||||
private accountService: AccountService,
|
private accountService: AccountService,
|
||||||
private history: GeneratorHistoryService,
|
private history: GeneratorHistoryService,
|
||||||
private dialogService: DialogService,
|
private dialogService: DialogService,
|
||||||
|
private dialogRef: DialogRef,
|
||||||
) {
|
) {
|
||||||
this.accountService.activeAccount$
|
this.accountService.activeAccount$
|
||||||
.pipe(
|
.pipe(
|
||||||
@@ -52,7 +54,13 @@ export class CredentialGeneratorHistoryDialogComponent {
|
|||||||
.subscribe(this.hasHistory$);
|
.subscribe(this.hasHistory$);
|
||||||
}
|
}
|
||||||
|
|
||||||
clear = async () => {
|
/** closes the dialog */
|
||||||
|
protected close() {
|
||||||
|
this.dialogRef.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Launches clear history flow */
|
||||||
|
protected async clear() {
|
||||||
const confirmed = await this.dialogService.openSimpleDialog({
|
const confirmed = await this.dialogService.openSimpleDialog({
|
||||||
title: { key: "clearGeneratorHistoryTitle" },
|
title: { key: "clearGeneratorHistoryTitle" },
|
||||||
content: { key: "cleargGeneratorHistoryDescription" },
|
content: { key: "cleargGeneratorHistoryDescription" },
|
||||||
@@ -64,5 +72,5 @@ export class CredentialGeneratorHistoryDialogComponent {
|
|||||||
if (confirmed) {
|
if (confirmed) {
|
||||||
await this.history.clear(await firstValueFrom(this.userId$));
|
await this.history.clear(await firstValueFrom(this.userId$));
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user