Skip to content

Commit

Permalink
fix #111
Browse files Browse the repository at this point in the history
<Disabled /> tags not working if no <Enabled /> is present
  • Loading branch information
larousso committed Jul 11, 2018
1 parent 425dddd commit 915893a
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 915893a

Please sign in to comment.