Actualizar servicios.html

This commit is contained in:
2026-02-16 22:39:09 +00:00
parent 79d8aaee1f
commit f97efb6f09

View File

@@ -508,11 +508,16 @@
const btn = document.getElementById('btnAuto');
btn.innerHTML = '<i data-lucide="loader-2" class="w-5 h-5 animate-spin mx-auto"></i>';
// Leemos si el usuario tiene activado el retraso (es true por defecto)
const savedSetting = localStorage.getItem('wa_delay_enabled');
const useDelay = savedSetting === null ? true : savedSetting === 'true';
try {
const res = await fetch(`${API_URL}/providers/automate/${id}`, {
method: 'POST',
headers: { "Content-Type": "application/json", "Authorization": `Bearer ${localStorage.getItem("token")}` },
body: JSON.stringify({ guild_id, cp })
// Añadimos useDelay al payload que va al servidor
body: JSON.stringify({ guild_id, cp, useDelay })
});
const data = await res.json();
if(data.ok) { closeDetailModal(); showToast("Enviado a la rueda de WhatsApp"); refreshPanel(); }