Add deprecation for `Discourse.SiteSettings` in a helper

Add deprecation for Discourse.SiteSettings in a helper

diff --git a/app/assets/javascripts/discourse/app/lib/settings.js b/app/assets/javascripts/discourse/app/lib/settings.js
index f4f6ae6..2013dec 100644
--- a/app/assets/javascripts/discourse/app/lib/settings.js
+++ b/app/assets/javascripts/discourse/app/lib/settings.js
@@ -1,5 +1,16 @@
+import deprecated from "discourse-common/lib/deprecated";
+
 export function prioritizeNameInUx(name, siteSettings) {
-  siteSettings = siteSettings || Discourse.SiteSettings;
+  if (!siteSettings) {
+    deprecated(
+      "You must supply `prioritizeNameInUx` with a `siteSettings` object",
+      {
+        since: "2.6.0",
+        dropFrom: "2.7.0"
+      }
+    );
+    siteSettings = Discourse.SiteSettings;
+  }
 
   return (
     !siteSettings.prioritize_username_in_ux && name && name.trim().length > 0

GitHub sha: 8456252c

1 Like

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