From 2e6280ce88274455155c464b05f1d1dcb7b22a17 Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Mon, 27 May 2024 08:12:53 -0400 Subject: [PATCH] Prefer UserKeyDefinition for user-scoped data (#9349) --- apps/browser/src/tools/popup/services/key-definitions.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/browser/src/tools/popup/services/key-definitions.ts b/apps/browser/src/tools/popup/services/key-definitions.ts index 9b256073f3..b4ccd991e7 100644 --- a/apps/browser/src/tools/popup/services/key-definitions.ts +++ b/apps/browser/src/tools/popup/services/key-definitions.ts @@ -1,23 +1,25 @@ 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 { BrowserSendComponentState } from "../../../models/browserSendComponentState"; -export const BROWSER_SEND_COMPONENT = new KeyDefinition( +export const BROWSER_SEND_COMPONENT = new UserKeyDefinition( BROWSER_SEND_MEMORY, "browser_send_component", { deserializer: (obj: Jsonify) => BrowserSendComponentState.fromJSON(obj), + clearOn: ["logout", "lock"], }, ); -export const BROWSER_SEND_TYPE_COMPONENT = new KeyDefinition( +export const BROWSER_SEND_TYPE_COMPONENT = new UserKeyDefinition( BROWSER_SEND_MEMORY, "browser_send_type_component", { deserializer: (obj: Jsonify) => BrowserComponentState.fromJSON(obj), + clearOn: ["logout", "lock"], }, );