mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 03:12:29 +00:00
feat(base/flags): add warning for unsupported feature flags
This commit is contained in:
committed by
Calinteodor
parent
753d0399c9
commit
40b8d6168b
@@ -1,4 +1,7 @@
|
||||
import logger from '../app/logger';
|
||||
|
||||
import { UPDATE_FLAGS } from './actionTypes';
|
||||
import * as featureFlags from './constants';
|
||||
|
||||
/**
|
||||
* Updates the current features flags with the given ones. They will be merged.
|
||||
@@ -10,6 +13,13 @@ import { UPDATE_FLAGS } from './actionTypes';
|
||||
* }}
|
||||
*/
|
||||
export function updateFlags(flags: Object) {
|
||||
const supportedFlags = Object.values(featureFlags);
|
||||
const unsupportedFlags = Object.keys(flags).filter(flag => !supportedFlags.includes(flag as any));
|
||||
|
||||
if (unsupportedFlags.length > 0) {
|
||||
logger.warn(`The following feature flags are not supported: ${unsupportedFlags.join(', ')}.`);
|
||||
}
|
||||
|
||||
return {
|
||||
type: UPDATE_FLAGS,
|
||||
flags
|
||||
|
||||
Reference in New Issue
Block a user