Poll Defaults

@nathank

I was looking at this code:

I think you can do the following:

api.modifyClass("component:modal/poll-ui-builder", {
  pluginId: 'poll-defaults',
  didInsertElement() {
    this._super(...arguments); // super.didInsertElement(...arguments); doesn't work (?)

    if (settings.Public) {this.set('publicPoll', true)}
    if (settings.Advanced) {this.set('showAdvanced', true)}
  }, 
});

It works.

However, I’m perplexed with didInsertElement.
poll-ui-builder is now a glimmer component. didInsertElement is not supposed to exist based on the ember upgrading guide.
I can see in core some usage. Maybe some specificity in Discourse?
Also, I’m not sure why super.didInsertElement doesn’t exist in this above code context.

1 Like