fleetmap-reports 1.0.759 → 1.0.760

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/zone-report.js +16 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetmap-reports",
3
- "version": "1.0.759",
3
+ "version": "1.0.760",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -154,20 +154,24 @@ async function processDevices (from, to, devices, userData, data) {
154
154
  }
155
155
  })
156
156
 
157
- groupByDay.push({
158
- date,
159
- geofences,
160
- distanceOut
161
- })
157
+ if (distanceOut && geofences.filter(g => g.distanceIn)) {
158
+ groupByDay.push({
159
+ date,
160
+ geofences,
161
+ distanceOut
162
+ })
163
+ }
162
164
  }
163
165
 
164
- devicesResult.push({
165
- device: d,
166
- from,
167
- to,
168
- zonesByColumn: true,
169
- days: groupByDay
170
- })
166
+ if (groupByDay.length) {
167
+ devicesResult.push({
168
+ device: d,
169
+ from,
170
+ to,
171
+ zonesByColumn: true,
172
+ days: groupByDay
173
+ })
174
+ }
171
175
  } else {
172
176
  devicesResult.push({
173
177
  device: d,