mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 05:13:29 +00:00
[PM-21554] - Creating a new item while editing edits the item (#14770)
* fix adding new cipher while editing a cipher * don't set updatedCipherView if the cached cipher has an id and the new one doesn't * fix cipher form config
This commit is contained in:
@@ -538,6 +538,7 @@ export class VaultV2Component implements OnInit, OnDestroy {
|
||||
}
|
||||
this.addType = type || this.activeFilter.cipherType;
|
||||
this.cipher = new CipherView();
|
||||
this.cipherId = null;
|
||||
await this.buildFormConfig("add");
|
||||
this.action = "add";
|
||||
this.prefillCipherFromFilter();
|
||||
|
||||
@@ -275,11 +275,6 @@ export class CipherFormComponent implements AfterViewInit, OnInit, OnChanges, Ci
|
||||
if (this.updatedCipherView.id === cachedCipher.id) {
|
||||
this.updatedCipherView = cachedCipher;
|
||||
}
|
||||
|
||||
// `id` is null when a cipher is being added
|
||||
if (this.updatedCipherView.id === null) {
|
||||
this.updatedCipherView = cachedCipher;
|
||||
}
|
||||
}
|
||||
|
||||
constructor(
|
||||
|
||||
Reference in New Issue
Block a user