notifications: Add support for None option in Notification sound.

This commit adds support for a `None` option in the dropdown menu
of `Notification sound`. When this option is selected, no audible
notification is sent to the user.

`None` will appear as the first option in the dropdown menu, since
this is not categorized as a playable audio.

This new option is added so that folks can disable audio notifications
without losing their other notification configuration (like for PMs, mentions).

Necessary test case is added for this new option.

Fixes #16090.
This commit is contained in:
akshatdalton
2021-04-27 23:04:06 +00:00
committed by Tim Abbott
parent 8e2042d378
commit b573964bfa
5 changed files with 42 additions and 7 deletions

View File

@@ -92,7 +92,9 @@ export function set_up() {
});
$("#play_notification_sound").on("click", () => {
$("#notification-sound-audio")[0].play();
if (page_params.notification_sound !== "none") {
$("#notification-sound-audio")[0].play();
}
});
const notification_sound_dropdown = $("#notification_sound");