Update main. #6
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Lyra Core Chat</title>
|
||||
<link rel="stylesheet" href="style.css?v=7" />
|
||||
<link rel="stylesheet" href="style.css?v=8" />
|
||||
<!-- PWA -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
@@ -252,13 +252,33 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
// Only show the stack quick-logger when a poker session is actually live —
|
||||
// otherwise logging just errors ("no live session").
|
||||
function updateStackQuickVisibility() {
|
||||
const box = document.getElementById("stackQuick");
|
||||
if (!box) return;
|
||||
fetch("/session/data", { cache: "no-store" })
|
||||
.then(function (r) { return r.json(); })
|
||||
.then(function (data) {
|
||||
const live = !!(data && data.session && data.session.is_live);
|
||||
box.style.display = live ? "flex" : "none";
|
||||
})
|
||||
.catch(function () { box.style.display = "none"; });
|
||||
}
|
||||
(function wireStackQuick() {
|
||||
const box = document.getElementById("stackQuick");
|
||||
const btn = document.getElementById("stackQuickBtn");
|
||||
const inp = document.getElementById("stackQuickInput");
|
||||
if (box) box.style.display = "none"; // hidden until a live session is confirmed
|
||||
if (btn) btn.addEventListener("click", stackQuickLog);
|
||||
if (inp) inp.addEventListener("keydown", function (e) {
|
||||
if (e.key === "Enter") { e.preventDefault(); stackQuickLog(); }
|
||||
});
|
||||
updateStackQuickVisibility();
|
||||
setInterval(updateStackQuickVisibility, 10000);
|
||||
document.addEventListener("visibilitychange", function () {
|
||||
if (!document.hidden) updateStackQuickVisibility();
|
||||
});
|
||||
})();
|
||||
|
||||
function generateSessionId() {
|
||||
|
||||
Reference in New Issue
Block a user