From a8f75e066b72929e5f73d1fce3aae55a4f4aaf44 Mon Sep 17 00:00:00 2001 From: Teppo Kurki Date: Wed, 3 Apr 2024 19:52:00 +0300 Subject: [PATCH] fix: gps output Fixes #60, broken with previous refactoring. --- src/HistoryAPI.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/HistoryAPI.ts b/src/HistoryAPI.ts index c688200..3630dbb 100644 --- a/src/HistoryAPI.ts +++ b/src/HistoryAPI.ts @@ -425,14 +425,15 @@ function outputPositionsGpx(data: DataResult, context: string, res: SimpleRespon ${context} ` let inSegment = false - // eslint-disable-next-line @typescript-eslint/no-explicit-any - data.data.forEach((p: any) => { - if (p.lat != null && p.lon != null) { + data.data.forEach((p: [Timestamp, [number, number]]) => { + const [time, position] = p + const [lon, lat] = position + if (lat !== null && lon !== null) { if (!inSegment) { responseBody += '\n' inSegment = true } - responseBody += `` + responseBody += `` } else { if (inSegment) { responseBody += ''