Code review

This commit is contained in:
robertpin 2023-03-03 10:42:28 +02:00
parent 7a51347c6a
commit 3b59a2b64a
2 changed files with 5 additions and 13 deletions

View File

@ -2,9 +2,7 @@ import { Theme } from '@mui/material';
import { withStyles } from '@mui/styles';
import React from 'react';
import { WithTranslation } from 'react-i18next';
import { connect } from 'react-redux';
import { IReduxState } from '../../../app/types';
import AbstractDialogTab, {
IProps as AbstractDialogTabProps } from '../../../base/dialog/components/web/AbstractDialogTab';
import { translate } from '../../../base/i18n/functions';
@ -264,13 +262,4 @@ class NotificationsTab extends AbstractDialogTab<IProps, any> {
}
}
const mapStateToProps = (_state: IReduxState) => {
const configuredTabs = interfaceConfig.SETTINGS_SECTIONS || [];
const showSoundsSettings = configuredTabs.includes('sounds');
return {
showSoundsSettings
};
};
export default connect(mapStateToProps)(withStyles(styles)(translate(NotificationsTab)));
export default withStyles(styles)(translate(NotificationsTab));

View File

@ -238,6 +238,8 @@ 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 || [],
@ -250,7 +252,8 @@ export function getNotificationsTabProps(stateful: IStateful) {
soundsTalkWhileMuted,
soundsReactions,
enableReactions,
moderatorMutedSoundsReactions
moderatorMutedSoundsReactions,
showSoundsSettings
};
}