(async function () { $("#buttons").append(``); $("#restart-quagga").click(function () { if (confirm("Are you sure?")) { const self = $(this); self.prop("disabled", true); (async function () { try { alert(await JSONRPC.__invoke("restart_quagga")); } finally { setTimeout(() => { self.prop("disabled", false); }, 5000); } })(); } }); })();