Skip to content

Commit

Permalink
FIX: Add an id to prevent memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
eviltrout committed Jun 21, 2019
1 parent d013e2f commit f4ab02e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion assets/javascripts/initializers/add-holiday-flair.js.es6
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default {
.append(iconHTML("calendar-alt")) .append(iconHTML("calendar-alt"))
.addClass("on-holiday"); .addClass("on-holiday");
}); });
}); }, { id: 'discourse-calendar' });


api.addPosterIcon(cfs => { api.addPosterIcon(cfs => {
const onHoliday = customBool(cfs.on_holiday); const onHoliday = customBool(cfs.on_holiday);
Expand Down

2 comments on commit f4ab02e

@discoursereviewbot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SamSaffron posted:

I wonder ... can "api" object auto inject this for plugins by default?

withPluginApi("0.1", "discourse-calender", api =>)

I know it would be a reasonably big change, but then the information about who owns what could be propagated everywhere. I guess there are still edge cases where you decorate cooked multiple times.

@discoursereviewbot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robin Ward posted:

Yeah it only really works when there is one decorator, and of course we'd need to change the plugin API to take a name.

This was the easiest and less intrusive solution @jjaffeux and I could come up with.

Please sign in to comment.