fleetmap-reports 1.0.935 → 1.0.936

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetmap-reports",
3
- "version": "1.0.935",
3
+ "version": "1.0.936",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -171,11 +171,11 @@ function processDevices (from, to, devices, data, userData, traccar) {
171
171
  if (userData.includeTemperature) {
172
172
  const tripRoute = deviceRoute.filter(p => trip.startTime <= p.fixTime && trip.endTime >= p.fixTime && p.attributes.temp1 !== 175)
173
173
  trip.maxTemp = tripRoute.reduce((a, b) => {
174
- return a > b.attributes.temp1 ? a : b.attributes.temp1
175
- }, 0)
174
+ return a && a > b.attributes.temp1 ? a : b.attributes.temp1
175
+ })
176
176
  trip.minTemp = tripRoute.reduce((a, b) => {
177
- return a < b.attributes.temp1 ? a : b.attributes.temp1
178
- }, 0)
177
+ return a && a < b.attributes.temp1 ? a : b.attributes.temp1
178
+ })
179
179
  trip.avgTemp = tripRoute.length > 0
180
180
  ? (tripRoute.reduce((a, b) => {
181
181
  return a + b.attributes.temp1