diff --git a/pandora_console/include/javascript/pandora_events.js b/pandora_console/include/javascript/pandora_events.js index 0320238673..fc8f4dd3dc 100644 --- a/pandora_console/include/javascript/pandora_events.js +++ b/pandora_console/include/javascript/pandora_events.js @@ -1338,6 +1338,7 @@ function listen_event_sound(settings) { ); } +let sound_listener; function check_event_sound(settings) { // Update elements time. $(".elements-discovered-alerts ul li").each(function() { @@ -1381,6 +1382,7 @@ function check_event_sound(settings) { }, function(data) { if (data != false) { + clearTimeout(sound_listener); // Hide empty. $("#tabs-sound-modal .empty-discovered-alerts").addClass( "invisible_important" @@ -1398,7 +1400,8 @@ function check_event_sound(settings) { $(".container-button-alert").addClass("fired"); // Remove audio. - //remove_audio(); + remove_audio(); + add_audio(settings.urlSound); // Add elements. @@ -1431,10 +1434,10 @@ function check_event_sound(settings) { }); // -100 delay sound. - //setTimeout( - // remove_audio, - // parseInt($("#tabs-sound-modal #time_sound").val()) * 1000 - 100 - //); + sound_listener = setTimeout( + remove_audio, + parseInt($("#tabs-sound-modal #time_sound").val()) * 1000 - 100 + ); } }, "json"