mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
fix(toolbarButtons): Store all buttons in redux.
The previous version of getToolbarButtons function was actually adding the custom buttons on every call to the config toolbarButtons array, effectively creating dublicates of every custom button. The PR fixes this issue. Also now we will be running the getToolbarButtons calculation only when needed.
This commit is contained in:
@@ -9,7 +9,6 @@ import { VISITORS_MODE_BUTTONS } from '../../../base/config/constants';
|
||||
import {
|
||||
getButtonNotifyMode,
|
||||
getButtonsWithNotifyClick,
|
||||
getToolbarButtons,
|
||||
isToolbarButtonEnabled
|
||||
} from '../../../base/config/functions.web';
|
||||
import { isMobileBrowser } from '../../../base/environment/utils';
|
||||
@@ -502,7 +501,7 @@ function _mapStateToProps(state: IReduxState, ownProps: any) {
|
||||
overflowDrawer
|
||||
} = state['features/toolbox'];
|
||||
const { clientWidth } = state['features/base/responsive-ui'];
|
||||
let toolbarButtons = ownProps.toolbarButtons || getToolbarButtons(state);
|
||||
let toolbarButtons = ownProps.toolbarButtons || state['features/toolbox'].toolbarButtons;
|
||||
|
||||
if (iAmVisitor(state)) {
|
||||
toolbarButtons = VISITORS_MODE_BUTTONS.filter(e => toolbarButtons.indexOf(e) > -1);
|
||||
|
||||
Reference in New Issue
Block a user