diff --git a/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenModels.swift b/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenModels.swift index 5811543c3..272424092 100644 --- a/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenModels.swift +++ b/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenModels.swift @@ -31,6 +31,8 @@ struct NotificationSettingsScreenViewState: BindableState { var applyingChange = false var selectedAlertTone: NotificationTone var availableCustomTones: [NotificationTone] + + let customToneSelectionEnabled: Bool } struct NotificationSettingsScreenViewStateBindings { diff --git a/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenViewModel.swift b/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenViewModel.swift index cd54de643..cff2956a6 100644 --- a/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenViewModel.swift +++ b/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenViewModel.swift @@ -43,7 +43,9 @@ class NotificationSettingsScreenViewModel: NotificationSettingsScreenViewModelTy super.init(initialViewState: NotificationSettingsScreenViewState(bindings: bindings, isModallyPresented: isModallyPresented, selectedAlertTone: appSettings.selectedNotificationTone ?? NotificationToneManager.defaultElementXMessageTone, - availableCustomTones: notificationToneManager.customTones())) + availableCustomTones: notificationToneManager.customTones(), + // macos lacks default sounds and its sandbox Sounds directory is immutable + customToneSelectionEnabled: !ProcessInfo.processInfo.isiOSAppOnMac)) // Listen for changes to AppSettings. appSettings.$enableNotifications diff --git a/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/View/NotificationSettingsScreen.swift b/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/View/NotificationSettingsScreen.swift index 11df431f6..cd0babb61 100644 --- a/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/View/NotificationSettingsScreen.swift +++ b/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/View/NotificationSettingsScreen.swift @@ -39,7 +39,9 @@ struct NotificationSettingsScreen: View { additionalSettingsSection } - soundSelectionSection + if context.viewState.customToneSelectionEnabled { + soundSelectionSection + } } } }