From 069760e3ecf08dd4a5f5cc8c514fbaadd0667c20 Mon Sep 17 00:00:00 2001 From: robertpin Date: Fri, 3 Mar 2023 10:56:00 +0200 Subject: [PATCH] Code review 2 --- react/features/settings/components/web/SettingsDialog.tsx | 2 +- react/features/settings/functions.any.ts | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/react/features/settings/components/web/SettingsDialog.tsx b/react/features/settings/components/web/SettingsDialog.tsx index aa4a07aca..d290ff2ea 100644 --- a/react/features/settings/components/web/SettingsDialog.tsx +++ b/react/features/settings/components/web/SettingsDialog.tsx @@ -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 diff --git a/react/features/settings/functions.any.ts b/react/features/settings/functions.any.ts index 381e4989e..ef4634646 100644 --- a/react/features/settings/functions.any.ts +++ b/react/features/settings/functions.any.ts @@ -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 || [],