1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-07 10:46:24 +03:00

Merge pull request #1473 from matrix-org/dbkr/honour_enablelabs

Honour the (now legacy) enableLabs flag
This commit is contained in:
Luke Barnard
2017-10-13 15:22:06 +02:00
committed by GitHub

View File

@@ -36,13 +36,21 @@ export default {
getLabsFeatures() {
const featuresConfig = SdkConfig.get()['features'] || {};
return FEATURES.filter((f) => {
const sdkConfigValue = featuresConfig[f.id];
// The old flag: honourned for backwards compat
const enableLabs = SdkConfig.get()['enableLabs'];
if (sdkConfigValue === 'labs') {
return true;
}
}).map((f) => {
let labsFeatures;
if (enableLabs) {
labsFeatures = FEATURES;
} else {
labsFeatures.filter((f) => {
const sdkConfigValue = featuresConfig[f.id];
if (sdkConfigValue === 'labs') {
return true;
}
});
}
return labsFeatures.map((f) => {
return f.id;
});
},