FIX: Pass `siteSettings` through in more places

FIX: Pass siteSettings through in more places

diff --git a/app/assets/javascripts/admin/models/report.js b/app/assets/javascripts/admin/models/report.js
index 9d2f25f..8475a26 100644
--- a/app/assets/javascripts/admin/models/report.js
+++ b/app/assets/javascripts/admin/models/report.js
@@ -340,7 +340,8 @@ const Report = EmberObject.extend({
 
       const avatarImg = renderAvatar(user, {
         imageSize: "tiny",
-        ignoreTitle: true
+        ignoreTitle: true,
+        siteSettings: this.siteSettings
       });
 
       return `<a href='${href}'>${avatarImg}<span class='username'>${user.name}</span></a>`;
diff --git a/app/assets/javascripts/discourse/app/components/about-page-users.js b/app/assets/javascripts/discourse/app/components/about-page-users.js
index ce25894..87d8bcf 100644
--- a/app/assets/javascripts/discourse/app/components/about-page-users.js
+++ b/app/assets/javascripts/discourse/app/components/about-page-users.js
@@ -21,7 +21,10 @@ export default Component.extend({
         name,
         username,
         userPath: userPath(username),
-        avatar: renderAvatar(user, { imageSize: "large" }),
+        avatar: renderAvatar(user, {
+          imageSize: "large",
+          siteSettings: this.siteSettings
+        }),
         title: user.title || "",
         formatedUsername: formatUsername(username),
         prioritizeName,
diff --git a/app/assets/javascripts/discourse/app/helpers/user-avatar.js b/app/assets/javascripts/discourse/app/helpers/user-avatar.js
index 0421799..7624ce7 100644
--- a/app/assets/javascripts/discourse/app/helpers/user-avatar.js
+++ b/app/assets/javascripts/discourse/app/helpers/user-avatar.js
@@ -1,5 +1,5 @@
 import { get } from "@ember/object";
-import { registerUnbound } from "discourse-common/lib/helpers";
+import { registerUnbound, helperContext } from "discourse-common/lib/helpers";
 import { avatarImg, formatUsername } from "discourse/lib/utilities";
 import { prioritizeNameInUx } from "discourse/lib/settings";
 import { htmlSafe } from "@ember/template";
@@ -32,6 +32,7 @@ export function classesForUser(u) {
 function renderAvatar(user, options) {
   options = options || {};
 
+  let siteSettings = helperContext().siteSettings;
   if (user) {
     const name = get(user, options.namePath || "name");
     const username = get(user, options.usernamePath || "username");
@@ -44,7 +45,7 @@ function renderAvatar(user, options) {
       return "";
     }
 
-    let displayName = prioritizeNameInUx(name)
+    let displayName = prioritizeNameInUx(name, siteSettings)
       ? name
       : formatUsername(username);
 
diff --git a/app/assets/javascripts/discourse/app/widgets/post.js b/app/assets/javascripts/discourse/app/widgets/post.js
index 93f988f..679f072 100644
--- a/app/assets/javascripts/discourse/app/widgets/post.js
+++ b/app/assets/javascripts/discourse/app/widgets/post.js
@@ -479,7 +479,8 @@ createWidget("post-notice", {
 
   html(attrs) {
     const user =
-      this.siteSettings.display_name_on_posts && prioritizeNameInUx(attrs.name)
+      this.siteSettings.display_name_on_posts &&
+      prioritizeNameInUx(attrs.name, this.siteSettings)
         ? attrs.name
         : attrs.username;
     let text, icon;

GitHub sha: 808b5aa5

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