Skip to content

Commit 83f7143

Browse files
authored
fix: don't prepend "notifications." to path if already there (#39)
1 parent 55b9650 commit 83f7143

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

signalk-send-notification.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,18 @@ module.exports = function(RED) {
4141
if ( typeof source !== 'undefined' && source.length === 0 ) {
4242
source = undefined
4343
}
44+
45+
if ( !path.startsWith('notifications.') ) {
46+
path = 'notifications.' + path
47+
}
4448

4549
let delta = {
4650
updates: [
4751
{
4852
$source: source,
4953
values: [
5054
{
51-
path: 'notifications.' + path,
55+
path,
5256
value: {
5357
state: state,
5458
method: method,

0 commit comments

Comments
 (0)