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:
+6
-6
@@ -3079,12 +3079,6 @@
|
|||||||
const makeName = makeId ? (settingsCache.makes.find(m => m.id == makeId) || {}).name || '' : '';
|
const makeName = makeId ? (settingsCache.makes.find(m => m.id == makeId) || {}).name || '' : '';
|
||||||
const modelName = modelId ? (settingsCache.models.find(m => m.id == modelId) || {}).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)
|
// F2: Auto-populate address from GPS (only if address field is empty)
|
||||||
if (AppState.gpsLat && !document.getElementById('manAddress').value.trim()) {
|
if (AppState.gpsLat && !document.getElementById('manAddress').value.trim()) {
|
||||||
const geo = await reverseGeocode(AppState.gpsLat, AppState.gpsLng);
|
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',
|
category: document.getElementById('manCatSelect').value || 'Other',
|
||||||
make: makeName,
|
make: makeName,
|
||||||
model: modelName,
|
model: modelName,
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user