This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -36,12 +36,21 @@ export default {
36
36
getLabsFeatures ( ) {
37
37
const featuresConfig = SdkConfig . get ( ) [ 'features' ] || { } ;
38
38
39
- return FEATURES . filter ( ( f ) => {
40
- const sdkConfigValue = featuresConfig [ f . id ] ;
41
- if ( ! [ 'enable' , 'disable' ] . includes ( sdkConfigValue ) ) {
42
- return true ;
43
- }
44
- } ) . map ( ( f ) => {
39
+ // The old flag: honourned for backwards compat
40
+ const enableLabs = SdkConfig . get ( ) [ 'enableLabs' ] ;
41
+
42
+ let labsFeatures ;
43
+ if ( enableLabs ) {
44
+ labsFeatures = FEATURES ;
45
+ } else {
46
+ labsFeatures = FEATURES . filter ( ( f ) => {
47
+ const sdkConfigValue = featuresConfig [ f . id ] ;
48
+ if ( sdkConfigValue === 'labs' ) {
49
+ return true ;
50
+ }
51
+ } ) ;
52
+ }
53
+ return labsFeatures . map ( ( f ) => {
45
54
return f . id ;
46
55
} ) ;
47
56
} ,
@@ -193,7 +202,7 @@ export default {
193
202
isFeatureEnabled : function ( featureId : string ) : boolean {
194
203
const featuresConfig = SdkConfig . get ( ) [ 'features' ] ;
195
204
196
- let sdkConfigValue = 'labs ' ;
205
+ let sdkConfigValue = 'disable ' ;
197
206
if ( featuresConfig && featuresConfig [ featureId ] !== undefined ) {
198
207
sdkConfigValue = featuresConfig [ featureId ] ;
199
208
}
You can’t perform that action at this time.
0 commit comments