Skip to content

Commit

Permalink
[FIx] #163, show uploadTIme if available
Browse files Browse the repository at this point in the history
  • Loading branch information
Type-Style committed Sep 16, 2024
1 parent eafd88e commit 5886c47
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/client/components/Status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ function getStatusData(entries) {
}

const ignoredEntries = entries.length - cleanEntries.length;
const uploadMean = getMean("time.uploadDuration").toFixed(3);
let uploadMean: number | string = getMean("time.uploadDuration");
if (uploadMean <= 0) { uploadMean = undefined } else { uploadMean = uploadMean.toFixed(3); }
const speedGPSMean = (getMean("speed.gps") * 3.6).toFixed(1);
const speedCalcMean = (getMean("speed.horizontal") * 3.6).toFixed(1);
const verticalCalc = getVertical();
Expand Down Expand Up @@ -113,13 +114,15 @@ function Status({ entries }: { entries: Models.IEntry[] }) {
</td>
</tr>

<tr>
<td><NetworkCheckIcon /></td>
<th>Ø upload</th>
<td>
{statusData.uploadMean}s
</td>
</tr>
{statusData.uploadMean &&
<tr>
<td><NetworkCheckIcon /></td>
<th>Ø upload</th>
<td>
{statusData.uploadMean}s
</td>
</tr>
}

<tr>
<td><SpeedIcon /></td>
Expand Down

0 comments on commit 5886c47

Please sign in to comment.