mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
fix(features): Allow checking features when jwt is not available. (#15906)
* fix(features): Allow checking features when jwt is not available. Fixes #15904. * squash: Drop unused import.
This commit is contained in:
@@ -89,12 +89,11 @@ export default function Toolbox({
|
||||
const toolbarButtonsToUse = toolbarButtons || reduxToolbarButtons;
|
||||
const chatOpen = useSelector((state: IReduxState) => state['features/chat'].isOpen);
|
||||
const isDialogVisible = useSelector((state: IReduxState) => Boolean(state['features/base/dialog'].component));
|
||||
const jwt = useSelector((state: IReduxState) => state['features/base/jwt'].jwt);
|
||||
const localParticipant = useSelector(getLocalParticipant);
|
||||
const transcribing = useSelector(isTranscribing);
|
||||
|
||||
// Do not convert to selector, it returns new array and will cause re-rendering of toolbox on every action.
|
||||
const jwtDisabledButtons = getJwtDisabledButtons(transcribing, jwt, localParticipant?.features);
|
||||
const jwtDisabledButtons = getJwtDisabledButtons(transcribing, localParticipant?.features);
|
||||
|
||||
const reactionsButtonEnabled = useSelector(isReactionsButtonEnabled);
|
||||
const _shouldDisplayReactionsButtons = useSelector(shouldDisplayReactionsButtons);
|
||||
|
||||
@@ -27,18 +27,15 @@ export function isAudioMuteButtonDisabled(state: IReduxState) {
|
||||
* This function is stateless as it returns a new array and may cause re-rendering.
|
||||
*
|
||||
* @param {boolean} isTranscribing - Whether there is currently a transcriber in the meeting.
|
||||
* @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(
|
||||
isTranscribing: boolean,
|
||||
jwt: string | undefined,
|
||||
localParticipantFeatures?: IParticipantFeatures) {
|
||||
const acc = [];
|
||||
|
||||
if (!isJwtFeatureEnabledStateless({
|
||||
jwt,
|
||||
localParticipantFeatures,
|
||||
feature: 'livestreaming',
|
||||
ifNotInFeatures: false
|
||||
@@ -47,7 +44,6 @@ export function getJwtDisabledButtons(
|
||||
}
|
||||
|
||||
if (!isTranscribing && !isJwtFeatureEnabledStateless({
|
||||
jwt,
|
||||
localParticipantFeatures,
|
||||
feature: 'transcription',
|
||||
ifNotInFeatures: false
|
||||
|
||||
Reference in New Issue
Block a user