Skip to content

Commit

Permalink
Fix Jetpack AI features control types (#39826)
Browse files Browse the repository at this point in the history
* add changelog

* fix types for featuresControl and add default value for logo-generator feature
  • Loading branch information
CGastrell authored and gogdzl committed Oct 25, 2024
1 parent 72d8f1f commit b496385
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: changed

AI Client: add types for AI assistant feature payload data branch featuresControl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ const INITIAL_STATE: LogoGeneratorStateProp = {
asyncRequestTimerId: 0,
isRequestingImage: false,
},
featuresControl: {
'logo-generator': {
enabled: false,
styles: [],
},
},
},
},
history: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ export type LogoGeneratorFeatureControl = FeatureControl & {

export type FeatureControl = {
enabled: boolean;
'min-jetpack-version': string;
[ key: string ]: FeatureControl | LogoGeneratorFeatureControl | boolean | string;
};

export type FeaturesControl = { [ key: string ]: FeatureControl };
export type FeaturesControl = {
[ key: string ]: FeatureControl | LogoGeneratorFeatureControl;
};

export type AiFeatureProps = {
hasFeature: boolean;
Expand Down

0 comments on commit b496385

Please sign in to comment.