599 lines
19 KiB
JavaScript
599 lines
19 KiB
JavaScript
// src/client/beatsaver.ts
|
|
var BASE_URL = "https://api.beatsaver.com";
|
|
var USE_RUNTIME_PROXY = typeof document !== "undefined";
|
|
function beatsaverUrl(path) {
|
|
if (USE_RUNTIME_PROXY) {
|
|
return `/api/beatsaver?path=${encodeURIComponent(path)}`;
|
|
}
|
|
return `${BASE_URL}${path}`;
|
|
}
|
|
async function fetchBeatSaverMeta(hash) {
|
|
try {
|
|
const response = await fetch(beatsaverUrl(`/maps/hash/${encodeURIComponent(hash)}`));
|
|
if (!response.ok) return null;
|
|
return await response.json();
|
|
} catch {
|
|
return null;
|
|
}
|
|
}
|
|
async function fetchBeatSaverMapById(mapId) {
|
|
try {
|
|
const response = await fetch(beatsaverUrl(`/maps/id/${encodeURIComponent(mapId)}`));
|
|
if (!response.ok) return null;
|
|
return await response.json();
|
|
} catch {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
// src/client/beatleader.ts
|
|
var BASE_URL2 = "https://api.beatleader.com";
|
|
var PAGE_SIZE = 100;
|
|
var USE_RUNTIME_PROXY2 = typeof document !== "undefined";
|
|
function beatleaderUrl(path) {
|
|
if (USE_RUNTIME_PROXY2) {
|
|
return `/api/beatleader?path=${encodeURIComponent(path)}`;
|
|
}
|
|
return `${BASE_URL2}${path}`;
|
|
}
|
|
async function fetchBLLeaderboardsByHash(hash) {
|
|
try {
|
|
const res = await fetch(beatleaderUrl(`/leaderboards/hash/${encodeURIComponent(hash)}`));
|
|
if (!res.ok) return [];
|
|
const data = await res.json();
|
|
const leaderboards = Array.isArray(data) ? data : Array.isArray(data.leaderboards) ? data.leaderboards : [];
|
|
return leaderboards;
|
|
} catch {
|
|
return [];
|
|
}
|
|
}
|
|
async function resolveBeatLeaderPlayerId(playerId) {
|
|
try {
|
|
const res = await fetch(beatleaderUrl(`/player/${encodeURIComponent(playerId)}`));
|
|
if (!res.ok) return playerId;
|
|
const data = await res.json();
|
|
const canonicalId = data.id;
|
|
return canonicalId == null ? playerId : String(canonicalId);
|
|
} catch {
|
|
return playerId;
|
|
}
|
|
}
|
|
async function fetchLeaderboardScoresById(leaderboardId, maxPages = 20) {
|
|
const scores = [];
|
|
for (let page = 1; page <= maxPages; page += 1) {
|
|
const qs = new URLSearchParams({
|
|
leaderboardContext: "general",
|
|
page: String(page),
|
|
sortBy: "rank",
|
|
order: "desc"
|
|
});
|
|
const url = beatleaderUrl(`/leaderboard/${encodeURIComponent(leaderboardId)}?${qs}`);
|
|
let res;
|
|
try {
|
|
res = await fetch(url);
|
|
} catch {
|
|
break;
|
|
}
|
|
if (!res.ok) break;
|
|
const payload = await res.json();
|
|
const batch = Array.isArray(payload.scores) ? payload.scores : [];
|
|
if (batch.length === 0) break;
|
|
scores.push(...batch);
|
|
if (batch.length < PAGE_SIZE) break;
|
|
}
|
|
return scores;
|
|
}
|
|
async function fetchAllMapScoresByHash(hash, leaderboards, maxPagesPerLeaderboard = 20) {
|
|
const requests = leaderboards.map((lb) => {
|
|
const leaderboardId = lb.id == null ? null : String(lb.id);
|
|
if (!leaderboardId) return Promise.resolve([]);
|
|
return fetchLeaderboardScoresById(leaderboardId, maxPagesPerLeaderboard);
|
|
});
|
|
const batches = await Promise.all(requests);
|
|
return batches.flat();
|
|
}
|
|
async function fetchFollowersPage(playerId, type2, page, count) {
|
|
const qs = new URLSearchParams({
|
|
type: type2,
|
|
page: String(page),
|
|
count: String(count)
|
|
});
|
|
const url = beatleaderUrl(`/player/${encodeURIComponent(playerId)}/followers?${qs}`);
|
|
try {
|
|
const response = await fetch(url);
|
|
if (!response.ok) return [];
|
|
const data = await response.json();
|
|
return Array.isArray(data) ? data : [];
|
|
} catch {
|
|
return [];
|
|
}
|
|
}
|
|
async function fetchAllFollowers(playerId, type2, maxPages = 100) {
|
|
const all = [];
|
|
for (let page = 1; page <= maxPages; page += 1) {
|
|
const batch = await fetchFollowersPage(playerId, type2, page, PAGE_SIZE);
|
|
if (batch.length === 0) break;
|
|
all.push(...batch);
|
|
if (batch.length < PAGE_SIZE) break;
|
|
}
|
|
return all;
|
|
}
|
|
async function fetchMutualFriendIds(playerId, maxPages = 100) {
|
|
const canonicalPlayerId = await resolveBeatLeaderPlayerId(playerId);
|
|
const [following, followers] = await Promise.all([
|
|
fetchAllFollowers(canonicalPlayerId, "Following", maxPages),
|
|
fetchAllFollowers(canonicalPlayerId, "Followers", maxPages)
|
|
]);
|
|
const followingIds = new Set(following.map((entry) => String(entry.id)));
|
|
const mutuals = /* @__PURE__ */ new Set();
|
|
for (const entry of followers) {
|
|
const id = String(entry.id);
|
|
if (followingIds.has(id)) {
|
|
mutuals.add(id);
|
|
}
|
|
}
|
|
return mutuals;
|
|
}
|
|
function normalizeAccuracy(value) {
|
|
if (typeof value !== "number" || !Number.isFinite(value)) return null;
|
|
return value <= 1 ? value * 100 : value;
|
|
}
|
|
|
|
// src/client/index.ts
|
|
function must(id) {
|
|
const element = document.getElementById(id);
|
|
if (!element) throw new Error(`Missing element: ${id}`);
|
|
return element;
|
|
}
|
|
function parseJson(raw) {
|
|
return JSON.parse(raw);
|
|
}
|
|
var beatSaberPlus = {
|
|
// https://github.com/hardcpp/BeatSaberPlus/wiki/%5BEN%5D-Song-Overlay
|
|
url: "ws://localhost:2947/socket",
|
|
onMessage: (e) => {
|
|
const data = parseJson(e.data);
|
|
switch (data._type) {
|
|
case "event":
|
|
switch (data._event) {
|
|
case "gameState":
|
|
document.body.dataset.gameState = data.gameStateChanged;
|
|
break;
|
|
case "mapInfo":
|
|
void updateMapInfo(data.mapInfoChanged);
|
|
break;
|
|
case "pause":
|
|
updateTime(data.pauseTime, true);
|
|
break;
|
|
case "resume":
|
|
updateTime(data.resumeTime, false);
|
|
break;
|
|
case "score":
|
|
updateScore(data.scoreEvent);
|
|
break;
|
|
}
|
|
break;
|
|
case "handshake":
|
|
currentPlayerPlatformId = data.playerPlatformId || "";
|
|
void refreshMapFriendScores();
|
|
break;
|
|
default:
|
|
console.log("message", e.data);
|
|
break;
|
|
}
|
|
}
|
|
};
|
|
var provider = beatSaberPlus;
|
|
var retryMs = 1e4;
|
|
var retries = 0;
|
|
var currentPlayerPlatformId = "";
|
|
function connect() {
|
|
console.log(`Connecting to ${provider.url} (attempt ${retries++})`);
|
|
const ws = new WebSocket(provider.url);
|
|
ws.onopen = onOpen;
|
|
ws.onmessage = provider.onMessage;
|
|
ws.onclose = onClose;
|
|
}
|
|
function onOpen() {
|
|
console.log("Connection open.");
|
|
retries = 0;
|
|
}
|
|
function onClose(e) {
|
|
console.log(`Connection closed. code: ${e.code}, reason: ${e.reason}, clean: ${e.wasClean}`);
|
|
setTimeout(connect, retryMs);
|
|
}
|
|
connect();
|
|
var cover = must("coverImg");
|
|
var title = must("title");
|
|
var subTitle = must("subTitle");
|
|
var artist = must("artist");
|
|
var mapper = must("mapper");
|
|
var difficulty = must("difficulty");
|
|
var characteristic = must("characteristicImg");
|
|
var difficultyLabel = must("difficultyLabel");
|
|
var type = must("type");
|
|
var bsrKey = must("bsrKey");
|
|
var timeMultiplier = 1;
|
|
var duration = 0;
|
|
async function updateMapInfo(data) {
|
|
const custom = data.level_id.startsWith("custom_level_");
|
|
const wip = custom && data.level_id.endsWith("WIP");
|
|
currentMapHash = custom ? data.level_id.substring(13, 53).toLowerCase() : "";
|
|
cover.src = data.coverRaw ? `data:image/jpeg;base64,${data.coverRaw}` : "images/unknown.svg";
|
|
title.textContent = data.name || "";
|
|
subTitle.textContent = data.sub_name || "";
|
|
artist.textContent = data.artist || "";
|
|
mapper.textContent = data.mapper || "";
|
|
difficulty.textContent = data.difficulty?.replace("Plus", " +") || "";
|
|
characteristic.src = `images/characteristic/${data.characteristic}.svg`;
|
|
difficultyLabel.textContent = "";
|
|
type.textContent = !custom ? "OST" : wip ? "WIP" : "";
|
|
bsrKey.textContent = data.BSRKey || "???";
|
|
timeMultiplier = data.timeMultiplier || 1;
|
|
duration = data.duration / 1e3;
|
|
void refreshMapFriendScores();
|
|
if (custom && !wip) {
|
|
document.body.classList.add("loading");
|
|
try {
|
|
const map = await fetchBeatSaverMeta(currentMapHash);
|
|
if (!map?.id) return;
|
|
bsrKey.textContent = map.id;
|
|
mapper.textContent = map.metadata?.levelAuthorName || "";
|
|
const diff = map.versions?.[0]?.diffs?.find((d) => d.characteristic === data.characteristic && d.difficulty === data.difficulty);
|
|
if (diff?.label) difficultyLabel.textContent = diff.label;
|
|
} finally {
|
|
document.body.classList.remove("loading");
|
|
}
|
|
} else {
|
|
bsrKey.textContent = "???";
|
|
difficultyLabel.textContent = "";
|
|
}
|
|
}
|
|
var timeText = must("timeText");
|
|
var timeBar = must("timeBar");
|
|
var intervalMs = 500;
|
|
var intervalId = 0;
|
|
var currentTime = 0;
|
|
function updateTime(time, paused) {
|
|
if (!settings.time) return;
|
|
setTime(time);
|
|
clearInterval(intervalId);
|
|
if (paused) return;
|
|
intervalId = window.setInterval(() => setTime(currentTime + intervalMs * timeMultiplier / 1e3), intervalMs);
|
|
}
|
|
function setTime(time) {
|
|
currentTime = time;
|
|
timeText.textContent = `${formatTime(currentTime)} / ${formatTime(duration)}`;
|
|
timeBar.style.width = `${currentTime / (duration || Infinity) * 100}%`;
|
|
}
|
|
function formatTime(t) {
|
|
t = Math.floor(t);
|
|
const minutes = Math.floor(t / 60);
|
|
const seconds = t - minutes * 60;
|
|
return `${minutes}:${String(seconds).padStart(2, "0")}`;
|
|
}
|
|
var accuracy = must("accuracy");
|
|
var mistakes = must("mistakes");
|
|
var friendScoresPanel = must("friendScores");
|
|
var friendScoresList = must("friendScoresList");
|
|
var friendScoresEmpty = must("friendScoresEmpty");
|
|
var currentMapHash = "";
|
|
var friendScoreRequestId = 0;
|
|
function updateScore(score) {
|
|
if (!settings.score) return;
|
|
accuracy.textContent = (score.accuracy * 100).toFixed(1);
|
|
mistakes.textContent = score.missCount ? String(score.missCount) : "";
|
|
accuracy.classList.toggle("failed", score.currentHealth === 0);
|
|
}
|
|
function clearFriendScores(message) {
|
|
friendScoresList.replaceChildren();
|
|
friendScoresEmpty.textContent = message;
|
|
friendScoresPanel.classList.remove("has-items", "is-loading");
|
|
}
|
|
function renderFriendScores(items) {
|
|
friendScoresList.replaceChildren();
|
|
friendScoresPanel.classList.toggle("has-items", items.length > 0);
|
|
friendScoresPanel.classList.remove("is-loading");
|
|
friendScoresEmpty.textContent = items.length ? "" : "No mutual scores on this map";
|
|
for (const item of items) {
|
|
const li = document.createElement("li");
|
|
li.className = "friend-score-item";
|
|
const name = document.createElement("span");
|
|
name.className = "friend-name";
|
|
name.textContent = item.name;
|
|
const acc = document.createElement("span");
|
|
acc.className = "friend-acc";
|
|
acc.textContent = `${item.acc.toFixed(2)}%`;
|
|
li.append(name, acc);
|
|
friendScoresList.appendChild(li);
|
|
}
|
|
}
|
|
async function refreshMapFriendScores() {
|
|
const hash = currentMapHash;
|
|
if (!settings.friends) {
|
|
clearFriendScores("Disabled in settings");
|
|
return;
|
|
}
|
|
if (!hash) {
|
|
clearFriendScores("No map loaded");
|
|
return;
|
|
}
|
|
const playerId = getEffectivePlayerId();
|
|
if (!playerId) {
|
|
clearFriendScores("Waiting for BeatLeader player id");
|
|
return;
|
|
}
|
|
friendScoresPanel.classList.add("is-loading");
|
|
friendScoresEmpty.textContent = "Loading mutual friend scores...";
|
|
const requestId = ++friendScoreRequestId;
|
|
try {
|
|
const [leaderboards, mutualFriendIds] = await Promise.all([
|
|
fetchBLLeaderboardsByHash(hash),
|
|
fetchMutualFriendIds(playerId)
|
|
]);
|
|
if (requestId !== friendScoreRequestId) return;
|
|
if (leaderboards.length === 0) {
|
|
clearFriendScores("No BeatLeader leaderboards found");
|
|
return;
|
|
}
|
|
if (mutualFriendIds.size === 0) {
|
|
clearFriendScores("No mutual BeatLeader followers");
|
|
return;
|
|
}
|
|
const scores = await fetchAllMapScoresByHash(hash, leaderboards);
|
|
if (requestId !== friendScoreRequestId) return;
|
|
const bestByPlayer = /* @__PURE__ */ new Map();
|
|
for (const score of scores) {
|
|
const playerId2 = score.playerId ?? (typeof score.player === "object" ? score.player?.id : null);
|
|
const playerKey = playerId2 == null ? "" : String(playerId2);
|
|
if (!playerKey || !mutualFriendIds.has(playerKey)) continue;
|
|
const acc = normalizeAccuracy(score.accuracy ?? score.acc);
|
|
if (acc === null) continue;
|
|
const existing = bestByPlayer.get(playerKey);
|
|
if (!existing || acc > existing.acc) {
|
|
const playerName = score.playerName || (typeof score.player === "object" ? score.player?.name : typeof score.player === "string" ? score.player : null);
|
|
bestByPlayer.set(playerKey, {
|
|
name: playerName || playerKey,
|
|
acc
|
|
});
|
|
}
|
|
}
|
|
const sorted = Array.from(bestByPlayer.values()).sort((a, b) => b.acc - a.acc);
|
|
renderFriendScores(sorted);
|
|
} catch {
|
|
if (requestId !== friendScoreRequestId) return;
|
|
clearFriendScores("Failed loading BeatLeader scores");
|
|
}
|
|
}
|
|
var settings = {
|
|
cover: true,
|
|
mapInfo: true,
|
|
time: true,
|
|
score: true,
|
|
friends: true,
|
|
bsr: false,
|
|
debug: false,
|
|
mockBsr: "4f4e4",
|
|
debugPlayerId: "76561199407393962",
|
|
right: false,
|
|
bottom: true,
|
|
scale: 1,
|
|
fade: 300
|
|
};
|
|
var defaults = structuredClone(settings);
|
|
var style = document.createElement("style");
|
|
function loadSettings() {
|
|
const params = new URLSearchParams(location.hash.slice(1));
|
|
let css = "";
|
|
for (const [key, def] of Object.entries(defaults)) {
|
|
const value = parseJson(params.get(key) || "null") ?? def;
|
|
settings[key] = value;
|
|
if (typeof def === "boolean") document.body.classList.toggle(key, Boolean(value));
|
|
else css += `--${key}: ${value}; `;
|
|
}
|
|
style.textContent = `:root { ${css}}`;
|
|
}
|
|
function saveSettings() {
|
|
const params = new URLSearchParams();
|
|
for (const [key, value] of Object.entries(settings)) {
|
|
if (value !== defaults[key]) params.set(key, JSON.stringify(value));
|
|
}
|
|
location.replace(`#${params.toString()}`);
|
|
}
|
|
async function applyMockMapFromBsr() {
|
|
const key = settings.mockBsr.trim();
|
|
if (!settings.debug || !key) return;
|
|
const map = await fetchBeatSaverMapById(key);
|
|
if (!map) return;
|
|
const hash = map.versions?.[0]?.hash?.toLowerCase?.() || "";
|
|
currentMapHash = hash;
|
|
title.textContent = map.metadata?.songName || map.name || title.textContent || "";
|
|
subTitle.textContent = map.metadata?.songSubName || "";
|
|
artist.textContent = map.metadata?.songAuthorName || "";
|
|
mapper.textContent = map.metadata?.levelAuthorName || "";
|
|
bsrKey.textContent = map.id || key;
|
|
type.textContent = "MOCK";
|
|
const coverUrl = map.versions?.[0]?.coverURL;
|
|
if (coverUrl) cover.src = coverUrl;
|
|
void refreshMapFriendScores();
|
|
}
|
|
function getEffectivePlayerId() {
|
|
const raw = settings.debug && settings.debugPlayerId.trim() ? settings.debugPlayerId.trim() : currentPlayerPlatformId;
|
|
if (!raw) return "";
|
|
const steamIdCandidate = raw.match(/\d{17,20}/)?.[0];
|
|
if (steamIdCandidate) return steamIdCandidate;
|
|
if (/^\d+$/.test(raw)) return raw;
|
|
if (settings.debug) return raw;
|
|
return "";
|
|
}
|
|
window.onhashchange = loadSettings;
|
|
loadSettings();
|
|
document.head.appendChild(style);
|
|
for (const key of [
|
|
"cover",
|
|
"mapInfo",
|
|
"time",
|
|
"score",
|
|
"friends",
|
|
"bsr",
|
|
"debug"
|
|
]) {
|
|
const input = must(`${key}Input`);
|
|
input.checked = settings[key];
|
|
input.oninput = () => {
|
|
settings[key] = input.checked;
|
|
saveSettings();
|
|
if (key === "friends") void refreshMapFriendScores();
|
|
if (key === "debug") {
|
|
void loadRequestQueue();
|
|
void applyMockMapFromBsr();
|
|
void refreshMapFriendScores();
|
|
}
|
|
};
|
|
}
|
|
var mockBsrInput = must("mockBsrInput");
|
|
mockBsrInput.value = settings.mockBsr;
|
|
mockBsrInput.oninput = () => {
|
|
settings.mockBsr = mockBsrInput.value.trim();
|
|
saveSettings();
|
|
void applyMockMapFromBsr();
|
|
};
|
|
var debugPlayerInput = must("debugPlayerInput");
|
|
debugPlayerInput.value = settings.debugPlayerId;
|
|
debugPlayerInput.oninput = () => {
|
|
settings.debugPlayerId = debugPlayerInput.value.trim();
|
|
saveSettings();
|
|
if (settings.debug) void refreshMapFriendScores();
|
|
};
|
|
void applyMockMapFromBsr();
|
|
var scale = must("scaleInput");
|
|
scale.valueAsNumber = settings.scale * 100;
|
|
scale.oninput = () => {
|
|
settings.scale = scale.valueAsNumber / 100;
|
|
saveSettings();
|
|
};
|
|
var position = must("positionInput");
|
|
position.value = JSON.stringify([
|
|
settings.right,
|
|
settings.bottom
|
|
]);
|
|
position.onchange = () => {
|
|
[settings.right, settings.bottom] = parseJson(position.value);
|
|
saveSettings();
|
|
};
|
|
var fade = must("fadeInput");
|
|
fade.valueAsNumber = settings.fade;
|
|
fade.oninput = () => {
|
|
settings.fade = fade.valueAsNumber;
|
|
saveSettings();
|
|
};
|
|
document.documentElement.onclick = () => document.body.classList.toggle("preview");
|
|
must("settings").onclick = (e) => e.stopPropagation();
|
|
var MAX_REQUESTS = 10;
|
|
var REQUEST_POLL_MS = 5e3;
|
|
var requestListEl = must("requestList");
|
|
var requestOverlayEl = must("requestOverlay");
|
|
var requestEmptyEl = must("requestEmpty");
|
|
var requestTitleCache = /* @__PURE__ */ new Map();
|
|
function useRequestHistorySim() {
|
|
return settings.debug || new URLSearchParams(location.search).get("debug") === "1";
|
|
}
|
|
function requestJsonFilenames() {
|
|
const explicit = new URLSearchParams(location.search).get("requests");
|
|
if (explicit) return [
|
|
explicit
|
|
];
|
|
if (useRequestHistorySim()) return [
|
|
"ChatRequest.json",
|
|
"database.json"
|
|
];
|
|
return [
|
|
"ChatRequest.json"
|
|
];
|
|
}
|
|
function loadJsonNextToPage(fileName) {
|
|
const base = new URL(fileName, location.href);
|
|
if (base.protocol !== "http:" && base.protocol !== "https:") {
|
|
throw new Error("not-http");
|
|
}
|
|
const busted = new URL(base.href);
|
|
busted.searchParams.set("t", String(Date.now()));
|
|
return fetch(busted.href, {
|
|
cache: "no-store"
|
|
}).then((res) => {
|
|
if (!res.ok) throw new Error(String(res.status));
|
|
return res.json();
|
|
});
|
|
}
|
|
async function loadRequestPayload() {
|
|
let lastErr;
|
|
for (const name of requestJsonFilenames()) {
|
|
try {
|
|
return await loadJsonNextToPage(name);
|
|
} catch (e) {
|
|
lastErr = e;
|
|
}
|
|
}
|
|
throw lastErr instanceof Error ? lastErr : new Error(String(lastErr));
|
|
}
|
|
function requesterLine(item) {
|
|
const parts = [
|
|
item.npr,
|
|
item.rqn
|
|
].filter(Boolean);
|
|
return parts.length ? parts.join(" ") : item.rqn || "";
|
|
}
|
|
async function enrichRequestTitle(key, titleEl) {
|
|
if (requestTitleCache.has(key)) {
|
|
titleEl.textContent = requestTitleCache.get(key) ?? "";
|
|
return;
|
|
}
|
|
try {
|
|
const map = await fetchBeatSaverMapById(key);
|
|
if (!map) return;
|
|
const name = map.metadata?.songName ?? map.name;
|
|
if (name && typeof name === "string") {
|
|
requestTitleCache.set(key, name);
|
|
titleEl.textContent = name;
|
|
}
|
|
} catch {
|
|
}
|
|
}
|
|
function renderRequestList(items) {
|
|
requestListEl.replaceChildren();
|
|
requestOverlayEl.classList.toggle("has-items", items.length > 0);
|
|
for (const item of items) {
|
|
const li = document.createElement("li");
|
|
li.className = "request-item";
|
|
const titleEl = document.createElement("span");
|
|
titleEl.className = "request-title";
|
|
titleEl.textContent = `!bsr ${item.key}`;
|
|
li.appendChild(titleEl);
|
|
const who = requesterLine(item);
|
|
if (who) {
|
|
const meta = document.createElement("span");
|
|
meta.className = "request-meta";
|
|
meta.textContent = who;
|
|
li.appendChild(meta);
|
|
}
|
|
requestListEl.appendChild(li);
|
|
void enrichRequestTitle(item.key, titleEl);
|
|
}
|
|
}
|
|
async function loadRequestQueue() {
|
|
try {
|
|
const data = await loadRequestPayload();
|
|
requestEmptyEl.textContent = "No pending requests";
|
|
requestOverlayEl.classList.remove("request-load-failed");
|
|
const raw = useRequestHistorySim() ? data.history ?? [] : data.queue ?? [];
|
|
const items = raw.slice(0, MAX_REQUESTS);
|
|
renderRequestList(items);
|
|
} catch {
|
|
requestEmptyEl.textContent = "whupsy, database file missing";
|
|
requestOverlayEl.classList.add("request-load-failed");
|
|
renderRequestList([]);
|
|
}
|
|
}
|
|
void loadRequestQueue();
|
|
window.setInterval(() => void loadRequestQueue(), REQUEST_POLL_MS);
|