Skip to content

Commit

Permalink
Invert the option on the UI for easier understanding
Browse files Browse the repository at this point in the history
  • Loading branch information
bor0 committed Dec 5, 2024
1 parent b08230b commit 7559bae
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions client/me/notification-settings/reader-subscriptions/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@ class NotificationSubscriptions extends Component {
return () => this.props.recordGoogleEvent( 'Me', 'Focused on ' + action );
}

handleCheckboxEvent( action ) {
handleCheckboxEvent( action, invert = false ) {
return ( event ) => {
const eventAction = 'Clicked ' + action + ' checkbox';
const optionValue = event.target.checked ? 1 : 0;

this.props.recordGoogleEvent( 'Me', eventAction, 'checked', optionValue );
const optionValue = invert ? ! event.target.checked : event.target.checked;
this.props.recordGoogleEvent( 'Me', `Clicked ${ action } checkbox`, 'checked', +optionValue );
};
}

Expand Down Expand Up @@ -243,21 +241,21 @@ class NotificationSubscriptions extends Component {

{ isAutomattician && (
<FormFieldset>
<FormLegend>
Disable auto-follow P2 posts upon commenting (Automatticians only)
</FormLegend>
<FormLegend>Auto-follow P2 posts (Automatticians only)</FormLegend>
<FormLabel>
<FormCheckbox
checked={ this.props.getSetting( 'p2_disable_autofollow_on_comment' ) }
checked={ ! this.props.getSetting( 'p2_disable_autofollow_on_comment' ) }
disabled={ this.props.getDisabledState() }
id="p2_disable_autofollow_on_comment"
name="p2_disable_autofollow_on_comment"
onChange={ this.props.toggleSetting }
onClick={ this.handleCheckboxEvent( 'Disable auto-follow P2 Upon Comment' ) }
onClick={ this.handleCheckboxEvent(
'Enable auto-follow P2 Upon Comment',
true
) }
/>
<span>
Don't automatically subscribe to notifications for a P2 post whenever you leave
a comment on it.
Automatically subscribe to P2 post notifications when you leave a comment.
</span>
</FormLabel>
</FormFieldset>
Expand Down

0 comments on commit 7559bae

Please sign in to comment.