diff --git a/libs/common/src/autofill/services/autofill-settings.service.ts b/libs/common/src/autofill/services/autofill-settings.service.ts index 49d6dc40de..eb6191d10b 100644 --- a/libs/common/src/autofill/services/autofill-settings.service.ts +++ b/libs/common/src/autofill/services/autofill-settings.service.ts @@ -9,40 +9,46 @@ import { GlobalState, KeyDefinition, StateProvider, + UserKeyDefinition, } from "../../platform/state"; import { ClearClipboardDelay, AutofillOverlayVisibility } from "../constants"; import { ClearClipboardDelaySetting, InlineMenuVisibilitySetting } from "../types"; -const AUTOFILL_ON_PAGE_LOAD = new KeyDefinition(AUTOFILL_SETTINGS_DISK, "autofillOnPageLoad", { +const AUTOFILL_ON_PAGE_LOAD = new UserKeyDefinition(AUTOFILL_SETTINGS_DISK, "autofillOnPageLoad", { deserializer: (value: boolean) => value ?? false, + clearOn: [], }); -const AUTOFILL_ON_PAGE_LOAD_DEFAULT = new KeyDefinition( +const AUTOFILL_ON_PAGE_LOAD_DEFAULT = new UserKeyDefinition( AUTOFILL_SETTINGS_DISK, "autofillOnPageLoadDefault", { deserializer: (value: boolean) => value ?? false, + clearOn: [], }, ); -const AUTOFILL_ON_PAGE_LOAD_CALLOUT_DISMISSED = new KeyDefinition( +const AUTOFILL_ON_PAGE_LOAD_CALLOUT_DISMISSED = new UserKeyDefinition( AUTOFILL_SETTINGS_DISK, "autofillOnPageLoadCalloutIsDismissed", { deserializer: (value: boolean) => value ?? false, + clearOn: [], }, ); -const AUTOFILL_ON_PAGE_LOAD_POLICY_TOAST_HAS_DISPLAYED = new KeyDefinition( +const AUTOFILL_ON_PAGE_LOAD_POLICY_TOAST_HAS_DISPLAYED = new UserKeyDefinition( AUTOFILL_SETTINGS_DISK, "autofillOnPageLoadPolicyToastHasDisplayed", { deserializer: (value: boolean) => value ?? false, + clearOn: [], }, ); -const AUTO_COPY_TOTP = new KeyDefinition(AUTOFILL_SETTINGS_DISK, "autoCopyTotp", { +const AUTO_COPY_TOTP = new UserKeyDefinition(AUTOFILL_SETTINGS_DISK, "autoCopyTotp", { deserializer: (value: boolean) => value ?? true, + clearOn: [], }); const INLINE_MENU_VISIBILITY = new KeyDefinition( @@ -57,11 +63,12 @@ const ENABLE_CONTEXT_MENU = new KeyDefinition(AUTOFILL_SETTINGS_DISK, "enableCon deserializer: (value: boolean) => value ?? true, }); -const CLEAR_CLIPBOARD_DELAY = new KeyDefinition( +const CLEAR_CLIPBOARD_DELAY = new UserKeyDefinition( AUTOFILL_SETTINGS_DISK_LOCAL, "clearClipboardDelay", { deserializer: (value: ClearClipboardDelaySetting) => value ?? ClearClipboardDelay.Never, + clearOn: [], }, ); diff --git a/libs/common/src/autofill/services/badge-settings.service.ts b/libs/common/src/autofill/services/badge-settings.service.ts index dcd266f885..e2f62b38b3 100644 --- a/libs/common/src/autofill/services/badge-settings.service.ts +++ b/libs/common/src/autofill/services/badge-settings.service.ts @@ -3,12 +3,13 @@ import { map, Observable } from "rxjs"; import { BADGE_SETTINGS_DISK, ActiveUserState, - KeyDefinition, StateProvider, + UserKeyDefinition, } from "../../platform/state"; -const ENABLE_BADGE_COUNTER = new KeyDefinition(BADGE_SETTINGS_DISK, "enableBadgeCounter", { +const ENABLE_BADGE_COUNTER = new UserKeyDefinition(BADGE_SETTINGS_DISK, "enableBadgeCounter", { deserializer: (value: boolean) => value ?? true, + clearOn: [], }); export abstract class BadgeSettingsServiceAbstraction { diff --git a/libs/common/src/autofill/services/domain-settings.service.ts b/libs/common/src/autofill/services/domain-settings.service.ts index 6ef4d10c0a..4b36e8d2bf 100644 --- a/libs/common/src/autofill/services/domain-settings.service.ts +++ b/libs/common/src/autofill/services/domain-settings.service.ts @@ -29,11 +29,12 @@ const EQUIVALENT_DOMAINS = new UserKeyDefinition(DOMAIN_SETTINGS_DISK, "equivale clearOn: ["logout"], }); -const DEFAULT_URI_MATCH_STRATEGY = new KeyDefinition( +const DEFAULT_URI_MATCH_STRATEGY = new UserKeyDefinition( DOMAIN_SETTINGS_DISK, "defaultUriMatchStrategy", { deserializer: (value: UriMatchStrategySetting) => value ?? UriMatchStrategy.Domain, + clearOn: [], }, );