Skip to content
Snippets Groups Projects
Commit 19404ff2 authored by Stephen D's avatar Stephen D
Browse files

button fix

parent 81bfb59f
No related branches found
No related tags found
No related merge requests found
......@@ -163,15 +163,7 @@ function renderData() {
const key = keys[i];
const val = datas[key];
let buttons = [];
for (let i = 0; i < Object.keys(qr).length; i++) {
const k = Object.keys(qr)[i];
if (qr[k]) {
buttons.push(k);
}
}
html += `<tr><td>${key}</td><td>${val}</td><td>${buttons}</td></tr>`;
html += `<tr><td>${key}</td><td>${val.count}</td><td>${val.buttons}</td></tr>`;
}
html += "</table>";
......@@ -287,8 +279,19 @@ function tick() {
"#FF3B58",
);
datas[code.data] ||= 0;
datas[code.data] += 1;
if (!datas[code.data]) {
let buttons = [];
for (let i = 0; i < Object.keys(qr).length; i++) {
const k = Object.keys(qr)[i];
if (qr[k]) {
buttons.push(k);
}
}
datas[code.data] = { count: 1, buttons };
} else {
datas[code.data].count += 1;
}
renderData();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment