mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 22:33:35 +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.addType = type || this.activeFilter.cipherType;
|
||||||
this.cipher = new CipherView();
|
this.cipher = new CipherView();
|
||||||
|
this.cipherId = null;
|
||||||
await this.buildFormConfig("add");
|
await this.buildFormConfig("add");
|
||||||
this.action = "add";
|
this.action = "add";
|
||||||
this.prefillCipherFromFilter();
|
this.prefillCipherFromFilter();
|
||||||
|
|||||||
@@ -275,11 +275,6 @@ export class CipherFormComponent implements AfterViewInit, OnInit, OnChanges, Ci
|
|||||||
if (this.updatedCipherView.id === cachedCipher.id) {
|
if (this.updatedCipherView.id === cachedCipher.id) {
|
||||||
this.updatedCipherView = cachedCipher;
|
this.updatedCipherView = cachedCipher;
|
||||||
}
|
}
|
||||||
|
|
||||||
// `id` is null when a cipher is being added
|
|
||||||
if (this.updatedCipherView.id === null) {
|
|
||||||
this.updatedCipherView = cachedCipher;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
Reference in New Issue
Block a user