Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

settings: Enable notification sound picker for followed topic sounds.

Sahil Batrada3eb859251c
diff --git a/web/src/admin.ts b/web/src/admin.ts
index f1e6f70362a..392b4508584 100644
--- a/web/src/admin.ts
+++ b/web/src/admin.ts
@@ -271,7 +271,8 @@ export function build_page(): void {
desktop_icon_count_display_values: settings_config.desktop_icon_count_display_values,
enable_sound_select:
realm_user_settings_defaults.enable_sounds ||
- realm_user_settings_defaults.enable_stream_audible_notifications,
+ realm_user_settings_defaults.enable_stream_audible_notifications ||
+ realm_user_settings_defaults.enable_followed_topic_audible_notifications,
email_notifications_batching_period_values:
settings_config.email_notifications_batching_period_values,
realm_name_in_email_notifications_policy_values:
diff --git a/web/src/settings.ts b/web/src/settings.ts
index 87625d84689..3194f5c465c 100644
--- a/web/src/settings.ts
+++ b/web/src/settings.ts
@@ -105,7 +105,9 @@ export function build_page(): void {
page_params,
realm,
enable_sound_select:
- user_settings.enable_sounds || user_settings.enable_stream_audible_notifications,
+ user_settings.enable_sounds ||
+ user_settings.enable_stream_audible_notifications ||
+ user_settings.enable_followed_topic_audible_notifications,
zuliprc: "zuliprc",
botserverrc: "botserverrc",
can_create_new_bots: settings_bots.can_create_incoming_webhooks(),
diff --git a/web/src/settings_notifications.ts b/web/src/settings_notifications.ts
index 7c6707ba98f..4376e827e3d 100644
--- a/web/src/settings_notifications.ts
+++ b/web/src/settings_notifications.ts
@@ -350,18 +350,23 @@ export function set_up(settings_panel: SettingsPanel): void {
$notification_sound_dropdown.val(settings_object.notification_sound);
- $container.find(".enable_sounds, .enable_stream_audible_notifications").on("change", () => {
- if (
- $container.find(".enable_stream_audible_notifications").prop("checked") ||
- $container.find(".enable_sounds").prop("checked")
- ) {
- $notification_sound_dropdown.prop("disabled", false);
- $notification_sound_dropdown.parent().removeClass("control-label-disabled");
- } else {
- $notification_sound_dropdown.prop("disabled", true);
- $notification_sound_dropdown.parent().addClass("control-label-disabled");
- }
- });
+ $container
+ .find(
+ ".enable_sounds, .enable_stream_audible_notifications, .enable_followed_topic_audible_notifications",
+ )
+ .on("change", () => {
+ if (
+ $container.find(".enable_stream_audible_notifications").prop("checked") ||
+ $container.find(".enable_sounds").prop("checked") ||
+ $container.find(".enable_followed_topic_audible_notifications").prop("checked")
+ ) {
+ $notification_sound_dropdown.prop("disabled", false);
+ $notification_sound_dropdown.parent().removeClass("control-label-disabled");
+ } else {
+ $notification_sound_dropdown.prop("disabled", true);
+ $notification_sound_dropdown.parent().addClass("control-label-disabled");
+ }
+ });
set_notification_batching_ui(
$container,