Skip to content

Commit

Permalink
Fix undefined value in calcMethod delta
Browse files Browse the repository at this point in the history
  • Loading branch information
panaaj committed Jun 21, 2024
1 parent 6c1134f commit d8b36dc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG: @signalk/course-provider

## v1.0.3

- **Fixed**: - Value of `navigation.course.calcValues.calcMethod` being set to `undefined` when course is cleared.

## v1.0.2

- **Fixed**: - Remove erroneous unit conversion in TTG calculation.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@signalk/course-provider",
"version": "1.0.2",
"version": "1.0.3",
"description": "Course data provider plugin for SignalK Server.",
"main": "plugin/index.js",
"keywords": [
Expand Down
5 changes: 2 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ module.exports = (server: CourseComputerApp): Plugin => {
u.values.forEach((v: DeltaValue) => {
srcPaths[v.path] = v.value
if (v.path === 'navigation.position') {
server.debug(`navigation.position ${v.value} => calc()`)
server.debug(`navigation.position ${JSON.stringify(v.value)} => calc()`)
calc()
}
})
Expand Down Expand Up @@ -286,7 +286,6 @@ module.exports = (server: CourseComputerApp): Plugin => {
// trigger course calculations
const calc = () => {
if (srcPaths['navigation.position']) {
server.debug(`*** do course calculation ***`)
worker?.postMessage(srcPaths)
}
}
Expand Down Expand Up @@ -320,7 +319,7 @@ module.exports = (server: CourseComputerApp): Plugin => {
server.debug(`*** building course data delta ***`)
values.push({
path: `${calcPath}.calcMethod`,
value: source.calcMethod
value: config.calculations.method
})
values.push({
path: `${calcPath}.bearingTrackTrue`,
Expand Down

0 comments on commit d8b36dc

Please sign in to comment.