Trial page: throwaway ring poll to test a screen with a phone, swept after 2 h
This commit is contained in:
@@ -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;
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user