mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 16:53:34 +00:00
pm5273 Ensure prototype on cipher
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import { Observable, firstValueFrom } from "rxjs";
|
import { Observable, firstValueFrom } from "rxjs";
|
||||||
import { SemVer } from "semver";
|
import { SemVer } from "semver";
|
||||||
|
import { Jsonify } from "type-fest";
|
||||||
|
|
||||||
import { ApiService } from "../../abstractions/api.service";
|
import { ApiService } from "../../abstractions/api.service";
|
||||||
import { SearchService } from "../../abstractions/search.service";
|
import { SearchService } from "../../abstractions/search.service";
|
||||||
@@ -1058,7 +1059,16 @@ export class CipherService implements CipherServiceAbstraction {
|
|||||||
|
|
||||||
async getAddEditCipherInfo(): Promise<AddEditCipherInfo> {
|
async getAddEditCipherInfo(): Promise<AddEditCipherInfo> {
|
||||||
const info = await firstValueFrom(this.addEditCipherInfo$);
|
const info = await firstValueFrom(this.addEditCipherInfo$);
|
||||||
return info;
|
// ensure prototype on cipher
|
||||||
|
return info == null
|
||||||
|
? null
|
||||||
|
: {
|
||||||
|
cipher:
|
||||||
|
info?.cipher.toJSON != null
|
||||||
|
? info.cipher
|
||||||
|
: CipherView.fromJSON(info?.cipher as Jsonify<CipherView>),
|
||||||
|
collectionIds: info?.collectionIds,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
async setAddEditCipherInfo(value: AddEditCipherInfo) {
|
async setAddEditCipherInfo(value: AddEditCipherInfo) {
|
||||||
|
|||||||
Reference in New Issue
Block a user