Refactored polls module to use browser sessions for creation and voting routes.
CI / Formatting (push) Successful in 5s
CI / Linting (push) Successful in 5s
CI / Tests (Python 3.12) (push) Successful in 2m47s
CI / Tests (Python 3.13) (push) Successful in 2m46s
CI / Tests (Python 3.14) (push) Successful in 2m44s
CI / Type Checking (push) Successful in 9s
CI / Spelling (push) Successful in 6s

This commit is contained in:
2026-05-05 13:46:41 -04:00
parent 9ac4a17ac8
commit 4189b76f33
8 changed files with 136 additions and 295 deletions
+4 -4
View File
@@ -16,8 +16,8 @@
"use strict";
const config = window.POLL_CONFIG;
const tokenInfo = window.TOKEN_INFO;
if (!config || !tokenInfo) return;
const viewerInfo = window.VIEWER_INFO;
if (!config || !viewerInfo) return;
const timerEl = document.getElementById("timer");
let remaining = config.timeRemaining;
@@ -71,7 +71,7 @@
// Show vote counts immediately for non-hidden polls so the UI
// doesn't look identical to a hidden poll before SSE delivers data.
if (!config.hidden || tokenInfo.isModerator) {
if (!config.hidden || viewerInfo.isModerator) {
for (const el of document.querySelectorAll(".vote-count")) {
el.classList.remove("d-none");
}
@@ -79,7 +79,7 @@
// --- SSE connection ---
const evtSource = new EventSource(tokenInfo.eventsUrl);
const evtSource = new EventSource(viewerInfo.eventsUrl);
const parse = (e) => {
try {