fix: pass os/arch to launcher latest endpoint and improve skin/cape loading
This commit is contained in:
@@ -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 || '—');
|
||||||
|
|||||||
Reference in New Issue
Block a user