Skip to content

Commit

Permalink
fix(composite): fix apply button missing for composite exposes #1759
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Oct 24, 2023
1 parent 91f2121 commit 8be8925
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/features/composite/composite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type CompositeType = 'composite' | 'light' | 'switch' | 'cover' | 'lock' | 'fan'

interface CompositeProps extends BaseFeatureProps<CompositeFeature> {
type: CompositeType;
parentFeatures: (CompositeFeature | GenericExposedFeature)[];
parentFeatures?: (CompositeFeature | GenericExposedFeature)[];
stepsConfiguration?: Record<string, unknown>;
minimal?: boolean;
showEndpointLabels?: boolean;
Expand All @@ -39,8 +39,8 @@ export class Composite extends Component<CompositeProps & WithTranslation<'compo
};

isCompositeRoot = (): boolean => {
const { parentFeatures, feature } = this.props;
return isCompositeFeature(this.props.feature) && parentFeatures.length == 2;
const { parentFeatures } = this.props;
return isCompositeFeature(this.props.feature) && parentFeatures?.length == 1;
};

onCompositeFeatureApply = (): void => {
Expand Down

0 comments on commit 8be8925

Please sign in to comment.