1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-13 01:58:44 +02:00

Prefer UserKeyDefinitions for getUser state (#9487)

This commit is contained in:
Matt Gibson 2024-06-04 11:13:04 -04:00 committed by GitHub
parent 6fa12fea49
commit 3e93fc9461
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,7 +6,7 @@ import {
awaitAsync,
trackEmissions,
} from "../../../spec";
import { GENERATOR_DISK, KeyDefinition } from "../../platform/state";
import { GENERATOR_DISK, UserKeyDefinition } from "../../platform/state";
import { UserId } from "../../types/guid";
import { BufferedKeyDefinition } from "./buffered-key-definition";
@ -16,8 +16,9 @@ const SomeUser = "SomeUser" as UserId;
const accountService = mockAccountServiceWith(SomeUser);
type SomeType = { foo: boolean; bar: boolean };
const SOME_KEY = new KeyDefinition<SomeType>(GENERATOR_DISK, "fooBar", {
const SOME_KEY = new UserKeyDefinition<SomeType>(GENERATOR_DISK, "fooBar", {
deserializer: (jsonValue) => jsonValue as SomeType,
clearOn: [],
});
const BUFFER_KEY = new BufferedKeyDefinition<SomeType>(GENERATOR_DISK, "fooBar_buffer", {
deserializer: (jsonValue) => jsonValue as SomeType,