Skip to content

Commit

Permalink
Merge pull request #133 from MAIF/issue-128
Browse files Browse the repository at this point in the history
<Disabled /> tags not working if no <Enabled /> is present
  • Loading branch information
larousso authored Jul 11, 2018
2 parents f0c2c66 + 915893a commit 1cac3f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions izanami-clients/react/src/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class Feature extends Component {
return this.props.render(isActive);
}
}
if (isActive && enabledChildren.length > 0) {
if (isActive && (enabledChildren.length > 0 || disabledChildren.length > 0)) {
if (debug) console.log(`[Features] feature '${path}' is enabled, rendering first <Enabled /> component`);
if (debug) {
return (
Expand All @@ -107,7 +107,7 @@ export class Feature extends Component {
);
}
return enabledChildren[0];
} else if (!isActive && disabledChildren.length > 0) {
} else if (!isActive && (enabledChildren.length > 0 || disabledChildren.length > 0)) {
if (debug) console.log(`[Features] feature '${path}' is disabled, rendering first <Disabled /> component`);
if (debug) {
return (
Expand Down

0 comments on commit 1cac3f5

Please sign in to comment.