Fixed icon
This commit is contained in:
@@ -41,7 +41,7 @@ async function poll() {
|
|||||||
if(history.value.length > MAX_PTS) history.value.shift();
|
if(history.value.length > MAX_PTS) history.value.shift();
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => { await poll(); interval = setInterval(poll, 5000); });
|
onMounted(async () => { await poll(); interval = setInterval(poll, 1000); });
|
||||||
onUnmounted(() => clearInterval(interval));
|
onUnmounted(() => clearInterval(interval));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -124,11 +124,11 @@ app.get('/api/position', asyncHandler(async (req, res) => {
|
|||||||
|
|
||||||
// ── Icon ──────────────────────────────────────────────────────────────────────
|
// ── Icon ──────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
app.get('/api/icon/:icon', asyncHandler(async (req, res) => {
|
app.get('/api/icon/:icon', asyncHandler(async (req, res, next) => {
|
||||||
const { icon } = req.params;
|
const { icon } = req.params;
|
||||||
if(!icon) return next(); // 404 fallback can handle missing icons
|
if(!icon) return next(); // 404 fallback can handle missing icons
|
||||||
resp.contentType('image/png');
|
res.contentType('image/png');
|
||||||
resp.sendFile(await fetchIcon(icon));
|
res.sendFile(await fetchIcon(icon));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// ── Space ─────────────────────────────────────────────────────────────────────
|
// ── Space ─────────────────────────────────────────────────────────────────────
|
||||||
|
|||||||
Reference in New Issue
Block a user