Code review 2

This commit is contained in:
robertpin 2023-03-03 10:56:00 +02:00
parent 3b59a2b64a
commit 069760e3ec
2 changed files with 3 additions and 4 deletions

View File

@ -290,7 +290,7 @@ function _mapStateToProps(state: IReduxState, ownProps: any) {
enabledNotifications: tabState?.enabledNotifications || {}
};
},
props: getNotificationsTabProps(state),
props: getNotificationsTabProps(state, showSoundsSettings),
className: `settings-pane ${classes.settingsDialog}`,
submit: submitNotificationsTab,
icon: IconBell

View File

@ -222,10 +222,11 @@ export function getProfileTabProps(stateful: IStateful) {
*
* @param {(Function|Object)} stateful -The (whole) redux state, or redux's
* {@code getState} function to be used to retrieve the state.
* @param {boolean} showSoundsSettings - Whether to show the sound settings or not.
* @returns {Object} - The properties for the "Sounds" tab from settings
* dialog.
*/
export function getNotificationsTabProps(stateful: IStateful) {
export function getNotificationsTabProps(stateful: IStateful, showSoundsSettings?: boolean) {
const state = toState(stateful);
const {
soundsIncomingMessage,
@ -238,8 +239,6 @@ export function getNotificationsTabProps(stateful: IStateful) {
const enableReactions = isReactionsEnabled(state);
const moderatorMutedSoundsReactions = state['features/base/conference'].startReactionsMuted ?? false;
const enabledNotifications = getNotificationsMap(stateful);
const configuredTabs = interfaceConfig.SETTINGS_SECTIONS || [];
const showSoundsSettings = configuredTabs.includes('sounds');
return {
disabledSounds: state['features/base/config'].disabledSounds || [],