In the flowfuse dashboard code in nodes/widgets/ui-text.js I see the code
// Process the value using TypedInput configuration
const processValue = async () => {
const value = msg.payload // default to payload if evaluation fails
if (config.valueType && config.value) {
const results = await asyncEvaluateNodeProperty(RED, config.value, config.valueType, node, msg)
msg.payload = results
} else {
msg.payload = value
}
}
try {
await processValue()
} catch (err) {
node.warn('Error evaluating value property: ' + err.message)
// msg.payload remains unchanged on error
}
Am I right in thinking that processValue() can simplified to
// Process the value using TypedInput configuration
const processValue = async () => {
// defaults to leaving existing payload untouched if evaluation fails
if (config.valueType && config.value) {
msg.payload = await asyncEvaluateNodeProperty(RED, config.value, config.valueType, node, msg)
}
}
Or is there some subtlety that I am missing?