From 3b59a2b64a15ad06a3f2303aa01e3d1068942e1a Mon Sep 17 00:00:00 2001 From: robertpin Date: Fri, 3 Mar 2023 10:42:28 +0200 Subject: [PATCH] Code review --- .../settings/components/web/NotificationsTab.tsx | 13 +------------ react/features/settings/functions.any.ts | 5 ++++- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/react/features/settings/components/web/NotificationsTab.tsx b/react/features/settings/components/web/NotificationsTab.tsx index 1de527f27..7358144ef 100644 --- a/react/features/settings/components/web/NotificationsTab.tsx +++ b/react/features/settings/components/web/NotificationsTab.tsx @@ -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 { } } -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)); diff --git a/react/features/settings/functions.any.ts b/react/features/settings/functions.any.ts index ca6619da4..381e4989e 100644 --- a/react/features/settings/functions.any.ts +++ b/react/features/settings/functions.any.ts @@ -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 }; }