@@ -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