Trial page: throwaway ring poll to test a screen with a phone, swept after 2 h

This commit is contained in:
2026-08-16 22:11:33 +01:00
parent 1992397659
commit 60f5cffe08
9 changed files with 98 additions and 3 deletions
+12
View File
@@ -0,0 +1,12 @@
import { $, api, toast } from "./common.js";
$("#go").addEventListener("click", async (e) => {
e.target.disabled = true;
try {
const r = await api("POST", "/api/trial");
location.href = `/screen/${r.id}#${r.screen_key}`;
} catch (err) {
toast(err.code === "too_many_trials" ? "Trop d'essais en cours, réessayez plus tard" : `Erreur : ${err.message}`, "bad");
e.target.disabled = false;
}
});