@@ -45,9 +45,19 @@ module.exports = function (RED) {
4545 function init ( node , config ) {
4646 node . uiShared = uiShared // ensure we have a uiShared object on the node (for testing mainly)
4747
48+ if ( ! config . acceptsClientConfig ) {
49+ // for those upgrading, we need this for backwards compatibility
50+ config . acceptsClientConfig = [ 'ui-control' , 'ui-notification' ]
51+ }
52+
53+ if ( ! ( 'includeClientData' in config ) ) {
54+ // for those upgrading, we need this for backwards compatibility
55+ config . includeClientData = true
56+ }
57+
4858 // expose these properties at runtime
49- node . acceptsClientConfig = config . acceptsClientConfig || [ ] // which node types can be scoped to a specific client
50- node . includeClientData = config . includeClientData || false // whether to include client data in msg payloads
59+ node . acceptsClientConfig = config . acceptsClientConfig // which node types can be scoped to a specific client
60+ node . includeClientData = config . includeClientData // whether to include client data in msg payloads
5161
5262 // eventually check if we have routes used, so we can support multiple base UIs
5363 if ( ! uiShared . app ) {
@@ -275,7 +285,7 @@ module.exports = function (RED) {
275285 */
276286 function emit ( event , msg , wNode ) {
277287 Object . values ( uiShared . connections ) . forEach ( conn => {
278- const nodeAllowsConstraints = n . acceptsClientConfig . includes ( wNode . type )
288+ const nodeAllowsConstraints = n . acceptsClientConfig ? .includes ( wNode . type )
279289 if ( ( nodeAllowsConstraints && isValidConnection ( conn , msg ) ) || ! nodeAllowsConstraints ) {
280290 conn . emit ( event , msg )
281291 }
0 commit comments