fix: pass os/arch to launcher latest endpoint and improve skin/cape loading
All checks were successful
CI / lint (push) Successful in 16s
CI / test (push) Successful in 41s
CI / build (push) Successful in 17s
CI / docker (push) Successful in 1m7s

This commit is contained in:
2026-06-06 20:08:37 +03:00
parent 329c0d3fda
commit b8c136878b

View File

@@ -126,7 +126,12 @@
async function loadLauncherInfo() { async function loadLauncherInfo() {
try { try {
const res = await fetch('/api/launcher/latest'); const os = navigator.userAgent.includes('Mac') ? 'darwin' :
navigator.userAgent.includes('Win') ? 'windows' : 'linux';
const arch = navigator.userAgent.includes('x86_64') || navigator.userAgent.includes('WOW64') ? 'amd64' :
navigator.userAgent.includes('arm64') || navigator.userAgent.includes('aarch64') ? 'arm64' : 'amd64';
const res = await fetch('/api/launcher/latest?os=' + os + '&arch=' + arch);
if (!res.ok) return; if (!res.ok) return;
const data = await res.json(); const data = await res.json();
document.getElementById('latestVersion').textContent = 'Последняя версия: ' + (data.version || '—'); document.getElementById('latestVersion').textContent = 'Последняя версия: ' + (data.version || '—');