Add error handling to re-enable buttons on save failure

Co-authored-by: naielv <109038805+naielv@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-21 11:49:40 +00:00
parent 9e7f8ebd1f
commit 013413a01c

View File

@@ -507,6 +507,16 @@ PAGES.pagos = {
document.getElementById("actionStatus").style.display = "none";
setUrlHash("pagos," + ticketId);
}, SAVE_WAIT);
}).catch((e) => {
console.warn('DB.put error', e);
// Re-enable confirm button on error
var confirmBtn = document.getElementById(btn_confirm + "2");
if (confirmBtn) {
confirmBtn.disabled = false;
confirmBtn.style.opacity = "1";
}
document.getElementById("actionStatus").style.display = "none";
toastr.error("Error al guardar la transacción");
});
}