mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
Filters the toolbarButtons in redux depending on the visitor state instead of filtering them every time in mapStateToProps. This will prevent unnecessary rerenders of the toolbar. Additionally: - Moves visitor buttons const from features/config in features/toolbox. - Removes dublicate functions isButtonEnabled and isToolbarButtonEnabled. - Adds more buttons to the visitor allowed buttons which functionality has been any way accessible trough shortcuts or somewhere else. - Enables customButtons to be visible for visitors.
28 lines
751 B
TypeScript
28 lines
751 B
TypeScript
import { IReduxState } from '../app/types';
|
|
|
|
import { isReactionsEnabled } from './functions.any';
|
|
|
|
export * from './functions.any';
|
|
|
|
/**
|
|
* Returns the visibility state of the reactions menu.
|
|
*
|
|
* @param {Object} state - The state of the application.
|
|
* @returns {boolean}
|
|
*/
|
|
export function getReactionsMenuVisibility(state: IReduxState): boolean {
|
|
return state['features/reactions'].visible;
|
|
}
|
|
|
|
/**
|
|
* Whether or not the reactions button is enabled.
|
|
*
|
|
* @param {Object} state - The Redux state object.
|
|
* @returns {boolean}
|
|
*/
|
|
export function isReactionsButtonEnabled(state: IReduxState) {
|
|
const { toolbarButtons } = state['features/toolbox'];
|
|
|
|
return Boolean(toolbarButtons?.includes('reactions')) && isReactionsEnabled(state);
|
|
}
|