Skip to content

Commit

Permalink
Hide 'Show to Settings' for JP sites.
Browse files Browse the repository at this point in the history
Additionally, force show_to_logged_in value to ‘yes’ to make things
easier in the backend.
  • Loading branch information
dbspringer committed Nov 24, 2015
1 parent 697314e commit 26f84dc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions client/my-sites/ads/form-settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ module.exports = React.createClass( {
store = SettingsStore.getById( site.ID );

store.us_checked = 'yes' === store.us_resident;
if ( site.jetpack ) {
// JP doesn't matter, force yes to make things easier
store.show_to_logged_in = 'yes';
}

return store;
},
Expand All @@ -131,7 +135,7 @@ module.exports = React.createClass( {
name: '',
optimized_ads: false,
paypal: '',
show_to_logged_in: 'pause',
show_to_logged_in: this.props.site.jetpack ? 'yes' : 'pause',
state: '',
taxid_last4: '',
tos: 'signed',
Expand Down Expand Up @@ -377,8 +381,8 @@ module.exports = React.createClass( {
{ this.state.isSubmitting ? this.translate( 'Saving…' ) : this.translate( 'Save Settings' ) }
</FormButton>
</FormButtonsBar>
{ this.showAdsToOptions() }
{ this.additionalAdsOption() }
{ ! this.props.site.jetpack ? this.showAdsToOptions() : null }
{ ! this.props.site.jetpack ? this.additionalAdsOption() : null }
<FormSectionHeading>{ this.translate( 'Site Owner Information' ) }</FormSectionHeading>
{ this.siteOwnerOptions() }
{ this.state.us_checked ? this.taxOptions() : null }
Expand Down

0 comments on commit 26f84dc

Please sign in to comment.