Skip to content

Commit b109bfa

Browse files
Fix cached cipher issue
1 parent 2c43bb3 commit b109bfa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libs/vault/src/cipher-form/components/cipher-form.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,9 @@ export class CipherFormComponent implements AfterViewInit, OnInit, OnChanges, Ci
311311
}
312312

313313
// Use the cached cipher when it matches the cipher being edited
314-
if (this.updatedCipherView.id === cachedCipher.id) {
314+
// Don't use cached cipher for new ciphers (when updatedCipherView.id is null/undefined)
315+
// This prevents stale data from previous "new cipher" sessions from being loaded
316+
if (this.updatedCipherView.id && this.updatedCipherView.id === cachedCipher.id) {
315317
this.updatedCipherView = cachedCipher;
316318
}
317319
}

0 commit comments

Comments
 (0)