mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 14:23:32 +00:00
encapsulate kludge property to fix invalid credential type error (#15225)
This commit is contained in:
@@ -161,6 +161,14 @@ export class UserStateSubject<
|
|||||||
this.outputSubscription = userState$
|
this.outputSubscription = userState$
|
||||||
.pipe(
|
.pipe(
|
||||||
switchMap((userState) => userState.state$),
|
switchMap((userState) => userState.state$),
|
||||||
|
map((stored) => {
|
||||||
|
if (stored && typeof stored === "object" && ALWAYS_UPDATE_KLUDGE in stored) {
|
||||||
|
// related: ALWAYS_UPDATE_KLUDGE FIXME
|
||||||
|
delete stored[ALWAYS_UPDATE_KLUDGE];
|
||||||
|
}
|
||||||
|
|
||||||
|
return stored;
|
||||||
|
}),
|
||||||
this.declassify(encryptor$),
|
this.declassify(encryptor$),
|
||||||
this.adjust(combineLatestWith(constraints$)),
|
this.adjust(combineLatestWith(constraints$)),
|
||||||
takeUntil(anyComplete(account$)),
|
takeUntil(anyComplete(account$)),
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ describe("GeneratorProfileProvider", () => {
|
|||||||
await awaitAsync();
|
await awaitAsync();
|
||||||
const result = await firstValueFrom(stateProvider.getUserState$(SettingsKey, SomeUser));
|
const result = await firstValueFrom(stateProvider.getUserState$(SettingsKey, SomeUser));
|
||||||
|
|
||||||
expect(result).toEqual({ foo: "next value" });
|
expect(result).toMatchObject({ foo: "next value" });
|
||||||
});
|
});
|
||||||
|
|
||||||
it("waits for the user to become available", async () => {
|
it("waits for the user to become available", async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user