Skip to content

Commit 8958931

Browse files
function name change
1 parent db33a58 commit 8958931

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

packages/compass-preferences-model/src/preferences-schema.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,10 @@ export const storedUserPreferencesProps: Required<{
473473
short: 'Enable AI Features',
474474
long: 'Allow the use of AI features in Compass which make requests to 3rd party services.',
475475
},
476-
deriveValue: deriveValueFromOtherPreferences('enableGenAIFeatures', [
477-
'enableGenAIFeaturesAtlasOrg',
478-
'networkTraffic',
479-
]),
476+
deriveValue: deriveValueFromOtherPreferencesAsLogicalAnd(
477+
'enableGenAIFeatures',
478+
['enableGenAIFeaturesAtlasOrg', 'networkTraffic']
479+
),
480480
validator: z.boolean().default(true),
481481
type: 'boolean',
482482
},
@@ -1095,12 +1095,11 @@ function deriveNetworkTrafficOptionState<K extends keyof AllPreferences>(
10951095
}
10961096

10971097
/** Helper for deriving value/state for preferences from other preferences */
1098-
function deriveValueFromOtherPreferences<K extends keyof AllPreferences>(
1099-
property: K,
1100-
preferencesToDeriveFrom: K[]
1101-
): DeriveValueFunction<boolean> {
1098+
function deriveValueFromOtherPreferencesAsLogicalAnd<
1099+
K extends keyof AllPreferences
1100+
>(property: K, preferencesToDeriveFrom: K[]): DeriveValueFunction<boolean> {
11021101
return (v, s) => ({
1103-
value: v(property) && preferencesToDeriveFrom.every((p) => v(p)),
1102+
value: preferencesToDeriveFrom.every((p) => v(p)),
11041103
state:
11051104
s(property) ??
11061105
(preferencesToDeriveFrom.every((p) => v(p))

0 commit comments

Comments
 (0)