1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-09 05:00:10 +00:00

reactive key connector service

This commit is contained in:
Maciej Zieniuk
2025-03-25 17:06:11 +00:00
parent 9ca4939502
commit e1f8450ed6
4 changed files with 28 additions and 34 deletions

View File

@@ -61,7 +61,7 @@ export class RemovePasswordComponent implements OnInit {
return this.continuing || this.leaving;
}
async convert() {
convert = async () => {
this.continuing = true;
try {
@@ -71,7 +71,6 @@ export class RemovePasswordComponent implements OnInit {
variant: "success",
message: this.i18nService.t("removedMasterPassword"),
});
await this.keyConnectorService.removeConvertAccountRequired(this.activeUserId);
await this.router.navigate([""]);
} catch (e) {
@@ -79,9 +78,9 @@ export class RemovePasswordComponent implements OnInit {
this.handleActionError(e);
}
}
};
async leave() {
leave = async () => {
const confirmed = await this.dialogService.openSimpleDialog({
title: this.organization.name,
content: { key: "leaveOrganizationConfirmation" },
@@ -95,12 +94,12 @@ export class RemovePasswordComponent implements OnInit {
this.leaving = true;
try {
await this.organizationApiService.leave(this.organization.id);
await this.keyConnectorService.removeConvertAccountRequired(this.activeUserId);
this.toastService.showToast({
variant: "success",
message: this.i18nService.t("leftOrganization"),
});
await this.keyConnectorService.removeConvertAccountRequired(this.activeUserId);
await this.router.navigate([""]);
} catch (e) {
@@ -108,7 +107,7 @@ export class RemovePasswordComponent implements OnInit {
this.handleActionError(e);
}
}
};
handleActionError(e: unknown) {
let message = "";