diff --git a/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.html b/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.html
index 524d9dff20..20942da3fe 100644
--- a/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.html
+++ b/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.html
@@ -21,6 +21,7 @@
[routerLink]="[]"
[queryParams]="{ itemId: cipher.id, action: extensionRefreshEnabled ? 'view' : null }"
queryParamsHandling="merge"
+ [replaceUrl]="extensionRefreshEnabled"
title="{{ 'editItemWithName' | i18n: cipher.name }}"
type="button"
appStopProp
diff --git a/apps/web/src/app/vault/individual-vault/vault.component.ts b/apps/web/src/app/vault/individual-vault/vault.component.ts
index a288b298ba..8ad9deaf2b 100644
--- a/apps/web/src/app/vault/individual-vault/vault.component.ts
+++ b/apps/web/src/app/vault/individual-vault/vault.component.ts
@@ -47,7 +47,7 @@ import { MessagingService } from "@bitwarden/common/platform/abstractions/messag
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { Utils } from "@bitwarden/common/platform/misc/utils";
import { SyncService } from "@bitwarden/common/platform/sync";
-import { CipherId, OrganizationId, CollectionId } from "@bitwarden/common/types/guid";
+import { CipherId, CollectionId, OrganizationId } from "@bitwarden/common/types/guid";
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service";
import { TotpService } from "@bitwarden/common/vault/abstractions/totp.service";
@@ -722,10 +722,6 @@ export class VaultComponent implements OnInit, OnDestroy {
this.go({ cipherId: null, itemId: null, action: null });
}
- async navigateToCipher(cipher: CipherView) {
- this.go({ itemId: cipher?.id });
- }
-
async editCipher(cipher: CipherView, cloneMode?: boolean) {
return this.editCipherId(cipher?.id, cloneMode);
}
@@ -861,16 +857,19 @@ export class VaultComponent implements OnInit, OnDestroy {
// Wait for the dialog to close.
const result: ViewCipherDialogCloseResult = await lastValueFrom(dialogRef.closed);
+ // If the dialog was closed by clicking the edit button, navigate to open the edit dialog.
+ if (result?.action === ViewCipherDialogResult.Edited) {
+ this.go({ itemId: cipherView.id, action: "edit" });
+ return;
+ }
+
// If the dialog was closed by deleting the cipher, refresh the vault.
if (result?.action === ViewCipherDialogResult.Deleted) {
this.refresh();
- this.go({ cipherId: null, itemId: null, action: null });
}
- // If the dialog was closed by any other action (close button, escape key, etc), navigate back to the vault.
- if (!result?.action) {
- this.go({ cipherId: null, itemId: null, action: null });
- }
+ // Clear the query params when the view dialog closes
+ this.go({ cipherId: null, itemId: null, action: null });
}
async addCollection() {
diff --git a/apps/web/src/app/vault/individual-vault/view.component.html b/apps/web/src/app/vault/individual-vault/view.component.html
index d1caf76192..ca3a5fb865 100644
--- a/apps/web/src/app/vault/individual-vault/view.component.html
+++ b/apps/web/src/app/vault/individual-vault/view.component.html
@@ -3,13 +3,19 @@
{{ cipherTypeString }}
-
+
-