#13292 fixed acoustic console

This commit is contained in:
Daniel Cebrian 2024-04-09 11:14:13 +02:00
parent bd10db675c
commit 2f1a2c4dd4
1 changed files with 8 additions and 5 deletions

View File

@ -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"