fix: server odometer stat shows 0 when no odometer data exists
COALESCE(MAX(odometer), 0) returned 0 when all tracking rows have NULL odometer (expected before the car is connected — PID 0xA6 likely unsupported on 2013 Yaris). Now returns NULL which the overview JS renders as '—'. Co-authored-by: Copilot <[email protected]>
This commit is contained in:
@@ -142,7 +142,7 @@ async function loadStats() {
|
||||
document.getElementById('stat-drivetime').textContent = fmtDuration(d.total_drive_time_s);
|
||||
document.getElementById('stat-topspeed').textContent = d.top_speed_kmh.toFixed(0);
|
||||
document.getElementById('stat-videos').textContent = d.video_count;
|
||||
document.getElementById('stat-odometer').textContent = d.odometer_km.toFixed(0);
|
||||
document.getElementById('stat-odometer').textContent = d.odometer_km != null ? d.odometer_km.toFixed(0) : '—';
|
||||
}
|
||||
|
||||
async function loadRecentTrips() {
|
||||
|
||||
Reference in New Issue
Block a user