feat(header): perbarui logika notifikasi dan suara

- Tambahkan penundaan 5 detik sebelum memuat ulang halaman setelah suara notifikasi diputar.
- Ubah interval pemeriksaan notifikasi dari 1 ms menjadi 5000 ms untuk efisiensi.
This commit is contained in:
Daeng Deni Mardaeni 2025-04-23 10:44:27 +07:00
parent b7c3c18900
commit 8fdba24920

View File

@ -201,6 +201,9 @@
if (currentCount > previousNotificationCount) { if (currentCount > previousNotificationCount) {
// Play notification sound // Play notification sound
if (notificationSound) { if (notificationSound) {
setTimeout(() => {
window.location.reload();
},5000);
notificationSound.play().catch(error => { notificationSound.play().catch(error => {
console.error('Error playing notification sound:', error); console.error('Error playing notification sound:', error);
}); });
@ -235,7 +238,7 @@
} }
// Check for new notifications every 30 seconds // Check for new notifications every 30 seconds
setInterval(checkForNewNotifications, 1); setInterval(checkForNewNotifications, 5000);
}); });
</script> </script>
@endpush @endpush