Hello how are you? I've been using mmy delivery (https://babia.to/threads/my-delivery-wordpress-plugin.24214/page-6#post-1279721) for a while now and it's perfect! It's just that in the latest updates, no matter how hard I try, the sound notification doesn't work: this is supposed to be the code: const notificationSong = new Audio('/wp-content/plugins/my-delivey-wordpress/assets/notifications/ trim_phone.mp3');
notificationSong.play(); but in the new update it comes out like this:
async function doCheckApi(e){let t=document.querySelector(".fdm-orders-items");t=null!=t?t.id:0;try{const o=await fetch(e+"?oid="+t);if(o.ok){"updated"!=(await o.json()).status&&updateOrders()}else console.log("GET API error" )}catch(e){console.log(e.message)}}async function updateOrders(){const e=await fetch(order_ajax_object.ajax_url,{method:"POST",credentials:"same-origin",headers: {"Content-Type":"application/x-www-form-urlencoded","Cache-Control":"no-cache"},body:"action=update_orders&nonce="+order_ajax_object.nonce}),t=await e.json(),o=document.querySelectorAll(".fdm-orders-items, .fdm-orders-full-items"),r=document.querySelectorAll(".fdm-btn-order-action"),n =document.querySelectorAll(".order-print");if(o.forEach(e=>e.remove()),r.forEach(e=>e.setAttribute("data-manage-order-id", "")),n.forEach(e=>e.remove()),supportNotification()&&hasNotificationPermission()){const e=document.getElementById("myd-orders-panel-notification-status-label"),t ={};e&&(t.title=e.dataset.notificationTitle||"",t.body=e.dataset.notificationBody||""),sendNotification(t)}document.querySelector(".fdm-orders- loop").insertAdjacentHTML("afterbegin",t.loop),document.querySelector(".fdm-orders-full").insertAdjacentHTML("afterbegin",t.full),document.querySelector("#hide-prints" ).insertAdjacentHTML("afterbegin",t.print),screen.width<=980&&(document.querySelectorAll(".fdm-orders-full-details").display="none")}
someone help me solve?
notificationSong.play(); but in the new update it comes out like this:
async function doCheckApi(e){let t=document.querySelector(".fdm-orders-items");t=null!=t?t.id:0;try{const o=await fetch(e+"?oid="+t);if(o.ok){"updated"!=(await o.json()).status&&updateOrders()}else console.log("GET API error" )}catch(e){console.log(e.message)}}async function updateOrders(){const e=await fetch(order_ajax_object.ajax_url,{method:"POST",credentials:"same-origin",headers: {"Content-Type":"application/x-www-form-urlencoded","Cache-Control":"no-cache"},body:"action=update_orders&nonce="+order_ajax_object.nonce}),t=await e.json(),o=document.querySelectorAll(".fdm-orders-items, .fdm-orders-full-items"),r=document.querySelectorAll(".fdm-btn-order-action"),n =document.querySelectorAll(".order-print");if(o.forEach(e=>e.remove()),r.forEach(e=>e.setAttribute("data-manage-order-id", "")),n.forEach(e=>e.remove()),supportNotification()&&hasNotificationPermission()){const e=document.getElementById("myd-orders-panel-notification-status-label"),t ={};e&&(t.title=e.dataset.notificationTitle||"",t.body=e.dataset.notificationBody||""),sendNotification(t)}document.querySelector(".fdm-orders- loop").insertAdjacentHTML("afterbegin",t.loop),document.querySelector(".fdm-orders-full").insertAdjacentHTML("afterbegin",t.full),document.querySelector("#hide-prints" ).insertAdjacentHTML("afterbegin",t.print),screen.width<=980&&(document.querySelectorAll(".fdm-orders-full-details").display="none")}
someone help me solve?