Skip to content

Commit

Permalink
not sync inPrivResistFp
Browse files Browse the repository at this point in the history
  • Loading branch information
gdh1995 committed Jan 1, 2024
1 parent 7f9c81c commit fbfb465
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 3 additions & 0 deletions background/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ const storeAndPropagate = (key: string, value: any, map?: Dict<any>): void | 8 =

const setAndPost = (key: keyof SettingsToSync, value: any): void => {
keyInDownloading = key
if (key === "keyLayout") {
value = (value & ~kKeyLayout.inPrivResistFp_ff) | (settingsCache_[key] & kKeyLayout.inPrivResistFp_ff)
}
settings_.set_(key, value) // eslint-disable-line @typescript-eslint/no-unsafe-argument
keyInDownloading = ""
if (key in settings_.valuesToLoad_) {
Expand Down
6 changes: 2 additions & 4 deletions pages/options_defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -656,10 +656,10 @@ keyLayout.readValueFromElement_ = (): number => {
flags |= elIgnoreIfNotASCII.checked ? kKeyLayout.ignoreIfNotASCII
: elIgnoreIfNotASCII.indeterminate ? kKeyLayout.inCmdIgnoreIfNotASCII : 0
flags |= elIgnoreCaps.checked ? kKeyLayout.ignoreCaps : elIgnoreCaps.indeterminate ? kKeyLayout.ignoreCapsOnMac : 0
flags |= elInPrivResistFp.checked ? kKeyLayout.inPrivResistFp_ff : 0
}
flags |= elMapModifier.checked ? kKeyLayout.mapRightModifiers
: elMapModifier.indeterminate ? kKeyLayout.mapLeftModifiers : 0
flags |= elInPrivResistFp.checked ? kKeyLayout.inPrivResistFp_ff : 0
const old = keyLayout.previous_
if (old & kKeyLayout.fromOld && (old & ~kKeyLayout.fromOld) === flags) { flags |= kKeyLayout.fromOld }
return flags
Expand All @@ -674,9 +674,9 @@ keyLayout.populateElement_ = (value: number): void => {
elIgnoreIfNotASCII.indeterminate = !!(value & kKeyLayout.inCmdIgnoreIfNotASCII)
elIgnoreCaps.checked = always || !!(value & kKeyLayout.ignoreCaps)
elIgnoreCaps.indeterminate = !!(value & kKeyLayout.ignoreCapsOnMac)
elInPrivResistFp.checked = !!(value & kKeyLayout.inPrivResistFp_ff)
elMapModifier.checked = !!(value & kKeyLayout.mapRightModifiers)
elMapModifier.indeterminate = !!(value & (kKeyLayout.mapLeftModifiers))
elInPrivResistFp.checked = !!(value & kKeyLayout.inPrivResistFp_ff)
_lastKeyLayoutValue = value
onAlwaysIgnoreChange()
if (Option_.onFgCacheUpdated_) {
Expand All @@ -696,12 +696,10 @@ const onAlwaysIgnoreChange = (ev?: EventToPrevent): void => {
BooleanOption_.ToggleDisabled_(elIgnoreIfAlt, always)
BooleanOption_.ToggleDisabled_(elIgnoreIfNotASCII, always)
BooleanOption_.ToggleDisabled_(elIgnoreCaps, always)
BooleanOption_.ToggleDisabled_(elInPrivResistFp, always)
if (!ev) { /* empty */ }
else if (always) {
elIgnoreIfAlt.checked = elIgnoreIfNotASCII.checked = elIgnoreCaps.checked = true
elIgnoreIfNotASCII.indeterminate = elIgnoreCaps.indeterminate = false
elInPrivResistFp.checked = false
} else {
const old = keyLayout.innerFetch_()
if (typeof old === "number" && !(_lastKeyLayoutValue & kKeyLayout.alwaysIgnore)) {
Expand Down

0 comments on commit fbfb465

Please sign in to comment.