This commit is contained in:
Lizandro Guarnizo
2026-05-25 14:27:27 -05:00
parent 58d98f23aa
commit 471b2f50c6
2 changed files with 50 additions and 11 deletions
+12 -1
View File
@@ -238,7 +238,18 @@ function telegramApp() {
async loadConfigs() {
const res = await fetch('/app/loadtelegram');
this.configs = await res.json();
const data = await res.json();
this.configs = data;
// Pre-inicializar claves reactivas para cada config.
// Sin esto Alpine.js no detecta las asignaciones dinámicas cfg.ID -> value.
const tl = {}, tr = {}, to = {};
const wl = {}, wr = {}, wo = {};
for (const cfg of data) {
tl[cfg.ID] = false; tr[cfg.ID] = ''; to[cfg.ID] = false;
wl[cfg.ID] = false; wr[cfg.ID] = ''; wo[cfg.ID] = false;
}
this.testLoading = tl; this.testResult = tr; this.testOk = to;
this.webhookLoading = wl; this.webhookResult = wr; this.webhookOk = wo;
},
openAdd() {