Skip to content

Commit

Permalink
Ensure allow list toggle is off when main settings are disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
dkmyta committed Jul 17, 2024
1 parent bceaeed commit 45694fd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions projects/plugins/jetpack/_inc/client/security/allowList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ const AllowList = class extends Component {
<FormFieldset>
<div className="waf__settings__toggle-setting">
<ToggleControl
checked={ this.props.settings?.ipAllowListEnabled }
checked={
( isWafActive || isProtectActive ) && this.props.settings?.ipAllowListEnabled
}
toggling={
this.props.isUpdatingWafSettings &&
this.state.ipAllowListEnabled !== this.props.settings?.ipAllowListEnabled
Expand All @@ -181,7 +183,10 @@ const AllowList = class extends Component {
<div className="waf__settings__ips">
<Textarea
disabled={
this.props.isUpdatingWafSettings || ! this.props.settings?.ipAllowListEnabled
isWafActive ||
isProtectActive ||
this.props.isUpdatingWafSettings ||
! this.props.settings?.ipAllowListEnabled
}
name="ipAllowList"
placeholder={ __( 'Example:', 'jetpack' ) + '\n12.12.12.1\n12.12.12.2' }
Expand Down

0 comments on commit 45694fd

Please sign in to comment.