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

Commit

Permalink
turn on E2E and Scalar by default
Browse files Browse the repository at this point in the history
  • Loading branch information
ara4n committed Sep 16, 2016
1 parent 08543a6 commit c322a19
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/UserSettingsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ module.exports = {
return MatrixClientPeg.get().setAccountData("im.vector.web.settings", settings);
},

isFeatureEnabled: function(feature: string): boolean {
isFeatureEnabled: function(feature: string): ?boolean {
if (localStorage.getItem(`mx_labs_feature_${feature}`) === null) {
return null;
}
return localStorage.getItem(`mx_labs_feature_${feature}`) === 'true';
},

Expand Down
11 changes: 7 additions & 4 deletions src/components/structures/UserSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,18 @@ var AddThreepid = require('../../AddThreepid');
const LABS_FEATURES = [
{
name: 'Rich Text Editor',
id: 'rich_text_editor'
id: 'rich_text_editor',
default: false,
},
{
name: 'End-to-End Encryption',
id: 'e2e_encryption'
id: 'e2e_encryption',
default: true,
},
{
name: 'Integration Management',
id: 'integration_management'
id: 'integration_management',
default: true,
},
];

Expand Down Expand Up @@ -382,7 +385,7 @@ module.exports = React.createClass({
type="checkbox"
id={feature.id}
name={feature.id}
defaultChecked={UserSettingsStore.isFeatureEnabled(feature.id)}
defaultChecked={UserSettingsStore.isFeatureEnabled(feature.id) === null ? feature.default : UserSettingsStore.isFeatureEnabled(feature.id)}
onChange={e => {
UserSettingsStore.setFeatureEnabled(feature.id, e.target.checked);
this.forceUpdate();
Expand Down

1 comment on commit c322a19

@hackervera
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.