Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
Hide pre-release features section of advanced settings pane. (#333)
Browse files Browse the repository at this point in the history
* Hide pre-release features section of advanced settings pane.

* Combined two adjacent ifs to remove nesting
  • Loading branch information
csduarte authored and jwilander committed Nov 30, 2017
1 parent de01450 commit 20f4e61
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions components/user_settings/user_settings_advanced.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export default class AdvancedSettingsDisplay extends React.Component {
this.updateSection = this.updateSection.bind(this);
this.updateSetting = this.updateSetting.bind(this);
this.toggleFeature = this.toggleFeature.bind(this);
this.saveEnabledFeatures = this.saveEnabledFeatures.bind(this);

this.saveEnabledFeatures = this.saveEnabledFeatures.bind(this);
this.renderFormattingSection = this.renderFormattingSection.bind(this);
this.renderJoinLeaveSection = this.renderJoinLeaveSection.bind(this);

Expand Down Expand Up @@ -77,11 +77,15 @@ export default class AdvancedSettingsDisplay extends React.Component {

const isSaving = false;

return {preReleaseFeatures: PreReleaseFeatures,
const previewFeaturesEnabled = global.window.mm_config.EnablePreviewFeatures === 'true';

return {
preReleaseFeatures: PreReleaseFeatures,
settings,
preReleaseFeaturesKeys,
enabledFeatures,
isSaving
isSaving,
previewFeaturesEnabled
};
}

Expand Down Expand Up @@ -447,7 +451,7 @@ export default class AdvancedSettingsDisplay extends React.Component {

let previewFeaturesSection;
let previewFeaturesSectionDivider;
if (this.state.preReleaseFeaturesKeys.length > 0) {
if (this.state.previewFeaturesEnabled && this.state.preReleaseFeaturesKeys.length > 0) {
previewFeaturesSectionDivider = (
<div className='divider-light'/>
);
Expand Down

0 comments on commit 20f4e61

Please sign in to comment.