1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-05 23:10:41 +03:00

Add experimental "Labs" section to settings

This commit is contained in:
Aviral Dasgupta
2016-06-13 22:04:12 +05:30
parent 469c415557
commit c3a9658392
2 changed files with 43 additions and 0 deletions

View File

@@ -112,4 +112,14 @@ module.exports = {
append: true, // We always append for email pushers since we don't want to stop other accounts notifying to the same email address
});
},
isFeatureEnabled: function(feature: string): boolean {
feature = feature.match(/\w+/g).join('_').toLowerCase();
return localStorage.getItem(`mx_labs_feature_${feature}`) === 'true';
},
setFeatureEnabled: function(feature: string, enabled: boolean) {
feature = feature.match(/\w+/g).join('_').toLowerCase();
localStorage.setItem(`mx_labs_feature_${feature}`, enabled);
}
};