Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
fix(jwt): Fixes getJwtDisabledButtons to respect moderator flag.
damencho808bc24d9540
diff --git a/react/features/toolbox/components/web/Toolbox.tsx b/react/features/toolbox/components/web/Toolbox.tsxindex 6ec5a73db9..84fa283cc2 100644--- a/react/features/toolbox/components/web/Toolbox.tsx+++ b/react/features/toolbox/components/web/Toolbox.tsx@@ -100,7 +100,7 @@ export default function Toolbox({const jwt = useSelector((state: IReduxState) => state['features/base/jwt'].jwt);const localParticipant = useSelector(getLocalParticipant);const jwtDisabledButtons = useSelector((state: IReduxState) =>- getJwtDisabledButtons(state, jwt, localParticipant?.features));+ getJwtDisabledButtons(state, isModerator, jwt, localParticipant?.features));const reactionsButtonEnabled = useSelector(isReactionsButtonEnabled);const _shouldDisplayReactionsButtons = useSelector(shouldDisplayReactionsButtons);const toolbarVisible = useSelector(isToolboxVisible);diff --git a/react/features/toolbox/functions.any.ts b/react/features/toolbox/functions.any.tsindex e6ef59856c..8716d8dff1 100644--- a/react/features/toolbox/functions.any.ts+++ b/react/features/toolbox/functions.any.ts@@ -21,12 +21,14 @@ export function isAudioMuteButtonDisabled(state: IReduxState) {* Returns the buttons corresponding to features disabled through jwt.** @param {IReduxState} state - The state from the Redux store.+ * @param {boolean} isModerator - Whether local participant is moderator.* @param {string | undefined} jwt - The jwt token.* @param {ILocalParticipant} localParticipantFeatures - The features of the local participant.* @returns {string[]} - The disabled by jwt buttons array.*/export function getJwtDisabledButtons(state: IReduxState,+ isModerator: boolean,jwt: string | undefined,localParticipantFeatures?: IParticipantFeatures) {const acc = [];@@ -35,8 +37,8 @@ export function getJwtDisabledButtons(jwt,localParticipantFeatures,feature: 'livestreaming',- ifNoToken: true,- ifNotInFeatures: true+ ifNoToken: isModerator,+ ifNotInFeatures: isModerator})) {acc.push('livestreaming');}@@ -45,8 +47,8 @@ export function getJwtDisabledButtons(jwt,localParticipantFeatures,feature: 'transcription',- ifNoToken: true,- ifNotInFeatures: true+ ifNoToken: isModerator,+ ifNotInFeatures: isModerator})) {acc.push('closedcaptions');}