FEATURE: uses new API to display holiday in user-selector

FEATURE: uses new API to display holiday in user-selector

diff --git a/assets/javascripts/initializers/add-holiday-flair.js.es6 b/assets/javascripts/initializers/add-holiday-flair.js.es6
index 82e9a16..3802fe7 100644
--- a/assets/javascripts/initializers/add-holiday-flair.js.es6
+++ b/assets/javascripts/initializers/add-holiday-flair.js.es6
@@ -25,6 +25,20 @@ export default {
   name: "add-holiday-flair",
 
   initialize() {
+    withPluginApi("0.10.1", api => {
+      const usernames = api.container.lookup("site:main").users_on_holiday;
+
+      if (usernames && usernames.length > 0) {
+        api.addUsernameSelectorDecorator(username => {
+          if (usernames.includes(username)) {
+            return `<span class="on-holiday">${iconHTML(
+              "calendar-alt"
+            )}</span>`;
+          }
+        });
+      }
+    });
+
     withPluginApi("0.8", api => {
       const usernames = api.container.lookup("site:main").users_on_holiday;
 

GitHub sha: 81f205ea

1 Like