diff --git a/static/js/chat_socket_functions/etc_operations_for_chat_socket.js b/static/js/chat_socket_functions/etc_operations_for_chat_socket.js index 9ca6c63..397de26 100644 --- a/static/js/chat_socket_functions/etc_operations_for_chat_socket.js +++ b/static/js/chat_socket_functions/etc_operations_for_chat_socket.js @@ -7,7 +7,6 @@ function update_count_unread_messages (data) { } } -function play_required_beep (data) { - const beep = new Audio('/static/sounds/beep_2.mp3') +function play_required_beep (data,beep) { beep.play() } \ No newline at end of file diff --git a/static/js/chat_sockets.js b/static/js/chat_sockets.js index 68040ba..7f819cc 100644 --- a/static/js/chat_sockets.js +++ b/static/js/chat_sockets.js @@ -15,7 +15,7 @@ function sendMessageSocket (data) { chatSocket.onmessage = function (e) { - + const beep = new Audio('/static/sounds/beep_2.mp3') let old_item_tab_user_list = inital_old_tab() let old_item_tab_user = old_item_tab_user_list[0] let el_tab = old_item_tab_user_list[1] @@ -51,7 +51,7 @@ chatSocket.onmessage = function (e) { update_count_unread_messages(data) } if (data.required_beep === true) { - play_required_beep(data) + play_required_beep(data,beep) } }