Prefer UserKeyDefinition for user-scoped data (#9349)
This commit is contained in:
parent
c61ba41b97
commit
2e6280ce88
|
@ -1,23 +1,25 @@
|
||||||
import { Jsonify } from "type-fest";
|
import { Jsonify } from "type-fest";
|
||||||
|
|
||||||
import { BROWSER_SEND_MEMORY, KeyDefinition } from "@bitwarden/common/platform/state";
|
import { BROWSER_SEND_MEMORY, UserKeyDefinition } from "@bitwarden/common/platform/state";
|
||||||
|
|
||||||
import { BrowserComponentState } from "../../../models/browserComponentState";
|
import { BrowserComponentState } from "../../../models/browserComponentState";
|
||||||
import { BrowserSendComponentState } from "../../../models/browserSendComponentState";
|
import { BrowserSendComponentState } from "../../../models/browserSendComponentState";
|
||||||
|
|
||||||
export const BROWSER_SEND_COMPONENT = new KeyDefinition<BrowserSendComponentState>(
|
export const BROWSER_SEND_COMPONENT = new UserKeyDefinition<BrowserSendComponentState>(
|
||||||
BROWSER_SEND_MEMORY,
|
BROWSER_SEND_MEMORY,
|
||||||
"browser_send_component",
|
"browser_send_component",
|
||||||
{
|
{
|
||||||
deserializer: (obj: Jsonify<BrowserSendComponentState>) =>
|
deserializer: (obj: Jsonify<BrowserSendComponentState>) =>
|
||||||
BrowserSendComponentState.fromJSON(obj),
|
BrowserSendComponentState.fromJSON(obj),
|
||||||
|
clearOn: ["logout", "lock"],
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
export const BROWSER_SEND_TYPE_COMPONENT = new KeyDefinition<BrowserComponentState>(
|
export const BROWSER_SEND_TYPE_COMPONENT = new UserKeyDefinition<BrowserComponentState>(
|
||||||
BROWSER_SEND_MEMORY,
|
BROWSER_SEND_MEMORY,
|
||||||
"browser_send_type_component",
|
"browser_send_type_component",
|
||||||
{
|
{
|
||||||
deserializer: (obj: Jsonify<BrowserComponentState>) => BrowserComponentState.fromJSON(obj),
|
deserializer: (obj: Jsonify<BrowserComponentState>) => BrowserComponentState.fromJSON(obj),
|
||||||
|
clearOn: ["logout", "lock"],
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue