mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 06:13:38 +00:00
[PM-24066] - handle unknown ciphers in individual vault (#17323)
* handle unknown ciphers in individual vault * handle in edit
This commit is contained in:
@@ -550,15 +550,7 @@ export class VaultComponent<C extends CipherViewLike> implements OnInit, OnDestr
|
|||||||
await this.editCipherId(cipherId);
|
await this.editCipherId(cipherId);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.toastService.showToast({
|
await this.handleUnknownCipher();
|
||||||
variant: "error",
|
|
||||||
title: null,
|
|
||||||
message: this.i18nService.t("unknownCipher"),
|
|
||||||
});
|
|
||||||
await this.router.navigate([], {
|
|
||||||
queryParams: { itemId: null, cipherId: null },
|
|
||||||
queryParamsHandling: "merge",
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
@@ -714,6 +706,18 @@ export class VaultComponent<C extends CipherViewLike> implements OnInit, OnDestr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async handleUnknownCipher() {
|
||||||
|
this.toastService.showToast({
|
||||||
|
variant: "error",
|
||||||
|
title: null,
|
||||||
|
message: this.i18nService.t("unknownCipher"),
|
||||||
|
});
|
||||||
|
await this.router.navigate([], {
|
||||||
|
queryParams: { itemId: null, cipherId: null },
|
||||||
|
queryParamsHandling: "merge",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async archive(cipher: C) {
|
async archive(cipher: C) {
|
||||||
const repromptPassed = await this.passwordRepromptService.passwordRepromptCheck(cipher);
|
const repromptPassed = await this.passwordRepromptService.passwordRepromptCheck(cipher);
|
||||||
|
|
||||||
@@ -997,6 +1001,10 @@ export class VaultComponent<C extends CipherViewLike> implements OnInit, OnDestr
|
|||||||
async editCipherId(id: string, cloneMode?: boolean) {
|
async editCipherId(id: string, cloneMode?: boolean) {
|
||||||
const activeUserId = await firstValueFrom(getUserId(this.accountService.activeAccount$));
|
const activeUserId = await firstValueFrom(getUserId(this.accountService.activeAccount$));
|
||||||
const cipher = await this.cipherService.get(id, activeUserId);
|
const cipher = await this.cipherService.get(id, activeUserId);
|
||||||
|
if (!cipher) {
|
||||||
|
await this.handleUnknownCipher();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
cipher &&
|
cipher &&
|
||||||
@@ -1034,6 +1042,10 @@ export class VaultComponent<C extends CipherViewLike> implements OnInit, OnDestr
|
|||||||
async viewCipherById(id: string) {
|
async viewCipherById(id: string) {
|
||||||
const activeUserId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId));
|
const activeUserId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId));
|
||||||
const cipher = await this.cipherService.get(id, activeUserId);
|
const cipher = await this.cipherService.get(id, activeUserId);
|
||||||
|
if (!cipher) {
|
||||||
|
await this.handleUnknownCipher();
|
||||||
|
return;
|
||||||
|
}
|
||||||
// If cipher exists (cipher is null when new) and MP reprompt
|
// If cipher exists (cipher is null when new) and MP reprompt
|
||||||
// is on for this cipher, then show password reprompt.
|
// is on for this cipher, then show password reprompt.
|
||||||
if (
|
if (
|
||||||
|
|||||||
Reference in New Issue
Block a user