Pass data to description to prevent duplication

Pass data to description to prevent duplication

diff --git a/app/assets/javascripts/discourse/widgets/custom-notification-item.js.es6 b/app/assets/javascripts/discourse/widgets/custom-notification-item.js.es6
index 75bac91..8ebff66 100644
--- a/app/assets/javascripts/discourse/widgets/custom-notification-item.js.es6
+++ b/app/assets/javascripts/discourse/widgets/custom-notification-item.js.es6
@@ -10,7 +10,7 @@ createWidgetFrom(DefaultNotificationItem, "custom-notification-item", {
 
   text(notificationName, data) {
     const username = formatUsername(data.display_username);
-    const description = this.description();
+    const description = this.description(data);
 
     return I18n.t(data.message, { description, username });
   },
diff --git a/app/assets/javascripts/discourse/widgets/default-notification-item.js.es6 b/app/assets/javascripts/discourse/widgets/default-notification-item.js.es6
index aa179be..a48899f 100644
--- a/app/assets/javascripts/discourse/widgets/default-notification-item.js.es6
+++ b/app/assets/javascripts/discourse/widgets/default-notification-item.js.es6
@@ -58,8 +58,7 @@ export const DefaultNotificationItem =
       }
     },
 
-    description() {
-      const data = this.attrs.data;
+    description(data) {
       const badgeName = data.badge_name;
       if (badgeName) {
         return escapeExpression(badgeName);
@@ -81,7 +80,7 @@ export const DefaultNotificationItem =
 
     text(notificationName, data) {
       const username = formatUsername(data.display_username);
-      const description = this.description();
+      const description = this.description(data);
 
       return I18n.t(`notifications.${notificationName}`, { description, username });
     },
diff --git a/app/assets/javascripts/discourse/widgets/liked-consolidated-notification-item.js.es6 b/app/assets/javascripts/discourse/widgets/liked-consolidated-notification-item.js.es6
index a23e31c..9c5f7d9 100644
--- a/app/assets/javascripts/discourse/widgets/liked-consolidated-notification-item.js.es6
+++ b/app/assets/javascripts/discourse/widgets/liked-consolidated-notification-item.js.es6
@@ -14,9 +14,7 @@ createWidgetFrom(DefaultNotificationItem, "liked-consolidated-notification-item"
     );
   },
 
-  description() {
-    const data = this.attrs.data;
-
+  description(data) {
     const description =
       I18n.t("notifications.liked_consolidated_description", {
         count: parseInt(data.count)
diff --git a/app/assets/javascripts/discourse/widgets/liked-notification-item.js.es6 b/app/assets/javascripts/discourse/widgets/liked-notification-item.js.es6
index aba3e0f..e24762e 100644
--- a/app/assets/javascripts/discourse/widgets/liked-notification-item.js.es6
+++ b/app/assets/javascripts/discourse/widgets/liked-notification-item.js.es6
@@ -5,7 +5,7 @@ import { formatUsername } from "discourse/lib/utilities";
 createWidgetFrom(DefaultNotificationItem, "liked-notification-item", {
   text(notificationName, data) {
     const username = formatUsername(data.display_username);
-    const description = this.description();
+    const description = this.description(data);
 
     if (data.count > 1) {
       const count = data.count - 2;

GitHub sha: 70e27641