Skip to content
Permalink
Browse files

FIX: Add an `id` to prevent memory leaks

  • Loading branch information...
eviltrout committed Jun 21, 2019
1 parent d013e2f commit f4ab02e4ec3284ce87573d5f37781d0cbc2e5903
Showing with 1 addition and 1 deletion.
  1. +1 −1 assets/javascripts/initializers/add-holiday-flair.js.es6
@@ -25,7 +25,7 @@ export default {
.append(iconHTML("calendar-alt"))
.addClass("on-holiday");
});
});
}, { id: 'discourse-calendar' });

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

2 comments on commit f4ab02e

@discoursereviewbot

This comment has been minimized.

Copy link

replied Jun 24, 2019

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

This comment has been minimized.

Copy link

replied Jun 24, 2019

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.
You can’t perform that action at this time.