FIX: define actions on connector class early (#6763)

FIX: define actions on connector class early (#6763)

This would prevent failure with connectors templates defining actions as closures. In this case action existence is checked at compile time and not runtime.

diff --git a/app/assets/javascripts/discourse/components/plugin-connector.js.es6 b/app/assets/javascripts/discourse/components/plugin-connector.js.es6
index bd1eaba..4d0ece9 100644
--- a/app/assets/javascripts/discourse/components/plugin-connector.js.es6
+++ b/app/assets/javascripts/discourse/components/plugin-connector.js.es6
@@ -12,6 +12,8 @@ export default Ember.Component.extend({
 
     const connectorClass = this.get("connector.connectorClass");
     connectorClass.setupComponent.call(this, args, this);
+
+    this.set("actions", connectorClass.actions);
   },
 
   @observes("args")

GitHub
sha: 5cb99d08

1 Like