fix(av-moderation) added optional chaining for moderation enabling

This commit is contained in:
Calin Chitu 2021-06-30 10:34:17 +03:00 committed by Дамян Минков
parent 2174368d23
commit ae9bea1a0c
1 changed files with 2 additions and 2 deletions

View File

@ -22,8 +22,8 @@ const getState = state => state['features/av-moderation'];
*/
export const isEnabledFromState = (mediaType: MediaType, state: Object) =>
(mediaType === MEDIA_TYPE.AUDIO
? getState(state).audioModerationEnabled
: getState(state).videoModerationEnabled) === true;
? getState(state)?.audioModerationEnabled
: getState(state)?.videoModerationEnabled) === true;
/**
* Returns whether moderation is enabled per media type.