Skip to content

Commit

Permalink
fix(current-state): fix for none type for state and data location
Browse files Browse the repository at this point in the history
Closes #126
  • Loading branch information
zachowj committed Jun 5, 2019
1 parent dcd418b commit 79fcf29
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions nodes/current-state/current-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,20 @@ module.exports = function(RED) {
state_type: nodeDef => nodeDef.state_type || 'str',
state_location: nodeDef => nodeDef.state_location || 'payload',
// state location type
override_payload: nodeDef =>
nodeDef.override_payload !== false ? 'msg' : 'none',
override_payload: nodeDef => {
if (nodeDef.state_location === undefined) {
return nodeDef.override_payload !== false ? 'msg' : 'none';
}
return nodeDef.override_payload;
},
entity_location: nodeDef => nodeDef.entity_location || 'data',
// entity location type
override_data: nodeDef =>
nodeDef.override_data !== false ? 'msg' : 'none',
override_data: nodeDef => {
if (nodeDef.entity_location === undefined) {
return nodeDef.override_data !== false ? 'msg' : 'none';
}
return nodeDef.override_data;
},
blockInputOverrides: {}
},
input: {
Expand Down

0 comments on commit 79fcf29

Please sign in to comment.