fix(settings): use moderator check helper (#4292)

This commit is contained in:
virtuacoplenny 2019-05-30 14:10:40 -07:00 committed by GitHub
parent b655c8d54a
commit ded355a807
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -2,7 +2,10 @@
import { toState } from '../base/redux';
import { parseStandardURIString } from '../base/util';
import { i18next, DEFAULT_LANGUAGE, LANGUAGES } from '../base/i18n';
import { getLocalParticipant, PARTICIPANT_ROLE } from '../base/participants';
import {
getLocalParticipant,
isLocalParticipantModerator
} from '../base/participants';
declare var interfaceConfig: Object;
@ -83,14 +86,12 @@ export function getMoreTabProps(stateful: Object | Function) {
} = state['features/base/conference'];
const followMeActive = Boolean(state['features/follow-me'].moderator);
const configuredTabs = interfaceConfig.SETTINGS_SECTIONS || [];
const localParticipant = getLocalParticipant(state);
// The settings sections to display.
const showModeratorSettings = Boolean(
conference
&& configuredTabs.includes('moderator')
&& localParticipant.role === PARTICIPANT_ROLE.MODERATOR);
&& isLocalParticipantModerator(state));
return {
currentLanguage: language,