From 91741a7fa485dfbfc82466cae7d0c37b43c50f29 Mon Sep 17 00:00:00 2001 From: Christopher Poile Date: Thu, 6 Jun 2024 15:32:01 -0400 Subject: [PATCH] [MM-58008] Calls Mobile: Settings for DM/GM ringing (#27213) * prevent webapp from erasing new mobile notify props * allow blank, will be used on mobile to default to desktop setting * update snapshots * Revert "update snapshots" This reverts commit 0bcd515de87e2e3fdd8a87e73f52c845577eddab. * Revert "allow blank, will be used on mobile to default to desktop setting" This reverts commit 56e16e887ff7bfbf3751778cc31cdd9e0e0f8086. * Revert "prevent webapp from erasing new mobile notify props" This reverts commit e983d7b8f4dbd92b12eeb312cdf64ec45cd2d6ec. * simplify how we handle mobile notification props * linting --------- Co-authored-by: Mattermost Build --- .../user_settings/notifications/user_settings_notifications.tsx | 2 +- webapp/platform/types/src/users.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/webapp/channels/src/components/user_settings/notifications/user_settings_notifications.tsx b/webapp/channels/src/components/user_settings/notifications/user_settings_notifications.tsx index 74eb42b307..d6305c1bb7 100644 --- a/webapp/channels/src/components/user_settings/notifications/user_settings_notifications.tsx +++ b/webapp/channels/src/components/user_settings/notifications/user_settings_notifications.tsx @@ -231,7 +231,7 @@ class NotificationsTab extends React.PureComponent { } handleSubmit = async () => { - const data: UserNotifyProps = {} as UserNotifyProps; + const data: UserNotifyProps = {...this.props.user.notify_props}; data.email = this.state.enableEmail; data.desktop_sound = this.state.desktopSound; data.calls_desktop_sound = this.state.callsDesktopSound; diff --git a/webapp/platform/types/src/users.ts b/webapp/platform/types/src/users.ts index ef60cc8ea2..1f281fbac6 100644 --- a/webapp/platform/types/src/users.ts +++ b/webapp/platform/types/src/users.ts @@ -28,6 +28,8 @@ export type UserNotifyProps = { push_threads?: 'default' | 'all' | 'mention' | 'none'; auto_responder_active?: 'true' | 'false'; auto_responder_message?: string; + calls_mobile_sound?: 'true' | 'false' | ''; + calls_mobile_notification_sound?: 'Dynamic' | 'Calm' | 'Urgent' | 'Cheerful' | ''; }; export type UserProfile = {