signalk-polar-performance-plugin 0.0.48 → 0.0.49

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/plugin/index.js +15 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "signalk-polar-performance-plugin",
3
- "version": "0.0.48",
3
+ "version": "0.0.49",
4
4
  "description": "A plugin that calculates performance information based on a (CSV) polar diagram.",
5
5
  "main": "plugin/index.js",
6
6
  "scripts": {
package/plugin/index.js CHANGED
@@ -314,21 +314,26 @@ module.exports = function (app) {
314
314
  }
315
315
  }
316
316
 
317
- let updates = {
317
+ if (firstUpdate) {
318
+ // Send meta updates
319
+ app.handleMessage(plugin.id, {
320
+ updates: [
321
+ {
322
+ meta: metas
323
+ }
324
+ ]
325
+ })
326
+ firstUpdate = false
327
+ }
328
+
329
+ // Send values updates
330
+ app.handleMessage(plugin.id, {
318
331
  updates: [
319
332
  {
320
333
  values: values
321
334
  }
322
335
  ]
323
- }
324
-
325
- if (firstUpdate) {
326
- updates.updates[0].metas = metas
327
- firstUpdate = false
328
- }
329
-
330
- // Send updates
331
- app.handleMessage(plugin.id, updates)
336
+ })
332
337
  }
333
338
 
334
339
  function getPerformanceData (TWS, TWA, BSP) {