Fix: move GPS geocode block outside payload object literal

The F2 auto-populate address block was accidentally inserted inside
the payload={} object literal, causing a JS syntax error that
broke the entire script and prevented the login screen from showing.
This commit is contained in:
2026-05-20 18:35:23 -04:00
parent d7f2e07c68
commit ffe9090668
3 changed files with 6 additions and 6 deletions
+6 -6
View File
@@ -3079,12 +3079,6 @@
const makeName = makeId ? (settingsCache.makes.find(m => m.id == makeId) || {}).name || '' : '';
const modelName = modelId ? (settingsCache.models.find(m => m.id == modelId) || {}).name || '' : '';
const payload = {
machine_id: machineId,
name: name,
serial_number: document.getElementById('manSerialNumber').value.trim(),
description: document.getElementById('manDescription').value.trim(),
// F2: Auto-populate address from GPS (only if address field is empty)
if (AppState.gpsLat && !document.getElementById('manAddress').value.trim()) {
const geo = await reverseGeocode(AppState.gpsLat, AppState.gpsLng);
@@ -3096,6 +3090,12 @@
}
}
}
const payload = {
machine_id: machineId,
name: name,
serial_number: document.getElementById('manSerialNumber').value.trim(),
description: document.getElementById('manDescription').value.trim(),
category: document.getElementById('manCatSelect').value || 'Other',
make: makeName,
model: modelName,