From 6ae24e6d4f2ba3aa6c804f59f3d56a88393c9e07 Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Sat, 19 Nov 2022 03:11:41 -0800 Subject: [PATCH] Update vote counts to reflect local votes --- src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.rs b/src/main.rs index a12f73a..528a230 100644 --- a/src/main.rs +++ b/src/main.rs @@ -130,6 +130,9 @@ const HTML_HEADER: &str = " cb.parentElement.removeChild(cb.previousElementSibling) if (req.status == 200) { cb.style.display = '' + const delta = cb.checked ? 1 : -1 + const count_td = cb.parentElement.previousElementSibling + count_td.textContent = parseInt(count_td.textContent) + delta } else { cb.parentElement.insertBefore(document.createTextNode('❗'), cb) } -- 2.44.1