REFACTOR: Remove `Discourse.SiteSettings` from desktop notifications

REFACTOR: Remove Discourse.SiteSettings from desktop notifications

diff --git a/app/assets/javascripts/discourse/app/components/desktop-notification-config.js b/app/assets/javascripts/discourse/app/components/desktop-notification-config.js
index ecd11c2..f3238f6 100644
--- a/app/assets/javascripts/discourse/app/components/desktop-notification-config.js
+++ b/app/assets/javascripts/discourse/app/components/desktop-notification-config.js
@@ -114,7 +114,7 @@ export default Component.extend({
       } else {
         this.set("notificationsDisabled", "");
         Notification.requestPermission(() => {
-          confirmNotification();
+          confirmNotification(this.siteSettings);
           this.notifyPropertyChange("notificationsPermission");
         });
       }
diff --git a/app/assets/javascripts/discourse/app/initializers/subscribe-user-notifications.js b/app/assets/javascripts/discourse/app/initializers/subscribe-user-notifications.js
index 407ab97..af11b97 100644
--- a/app/assets/javascripts/discourse/app/initializers/subscribe-user-notifications.js
+++ b/app/assets/javascripts/discourse/app/initializers/subscribe-user-notifications.js
@@ -131,7 +131,9 @@ export default {
       );
 
       if (!isTesting()) {
-        bus.subscribe(alertChannel(user), data => onNotification(data, user));
+        bus.subscribe(alertChannel(user), data =>
+          onNotification(data, siteSettings)
+        );
         initDesktopNotifications(bus, appEvents);
 
         if (isPushNotificationsEnabled(user, site.mobileView)) {
diff --git a/app/assets/javascripts/discourse/app/lib/desktop-notifications.js b/app/assets/javascripts/discourse/app/lib/desktop-notifications.js
index 48b5eb0..dc9938d 100644
--- a/app/assets/javascripts/discourse/app/lib/desktop-notifications.js
+++ b/app/assets/javascripts/discourse/app/lib/desktop-notifications.js
@@ -71,16 +71,14 @@ function init(messageBus, appEvents) {
   }
 }
 
-function confirmNotification() {
+function confirmNotification(siteSettings) {
   const notification = new Notification(
     I18n.t("notifications.popup.confirm_title", {
-      site_title: Discourse.SiteSettings.title
+      site_title: siteSettings.title
     }),
     {
       body: I18n.t("notifications.popup.confirm_body"),
-      icon:
-        Discourse.SiteSettings.site_logo_small_url ||
-        Discourse.SiteSettings.site_logo_url,
+      icon: siteSettings.site_logo_small_url || siteSettings.site_logo_url,
       tag: "confirm-subscription"
     }
   );
@@ -138,7 +136,7 @@ function isIdle() {
 }
 
 // Call-in point from message bus
-function onNotification(data) {
+function onNotification(data, siteSettings) {
   if (!liveEnabled) {
     return;
   }
@@ -153,7 +151,7 @@ function onNotification(data) {
   }
 
   const notificationTitle = I18n.t(i18nKey(data.notification_type), {
-    site_title: Discourse.SiteSettings.title,
+    site_title: siteSettings.title,
     topic: data.topic_title,
     username: formatUsername(data.username)
   });
@@ -161,14 +159,10 @@ function onNotification(data) {
   const notificationBody = data.excerpt;
 
   const notificationIcon =
-    Discourse.SiteSettings.site_logo_small_url ||
-    Discourse.SiteSettings.site_logo_url;
+    siteSettings.site_logo_small_url || siteSettings.site_logo_url;
 
   const notificationTag =
-    "discourse-notification-" +
-    Discourse.SiteSettings.title +
-    "-" +
-    data.topic_id;
+    "discourse-notification-" + siteSettings.title + "-" + data.topic_id;
 
   requestPermission().then(function() {
     // This shows the notification!

GitHub sha: 217b970e

This commit appears in #10290 which was merged by eviltrout.