Skip to content

A platform for community discussion. Free, open, simple.

FIX: Falls back to username if name is empty (#31481)

benj795413e6fdcd
diff --git a/app/assets/javascripts/discourse/app/lib/notification-types/liked.js b/app/assets/javascripts/discourse/app/lib/notification-types/liked.js
index 5b805d9f931..75d03baa6ed 100644
--- a/app/assets/javascripts/discourse/app/lib/notification-types/liked.js
+++ b/app/assets/javascripts/discourse/app/lib/notification-types/liked.js
@@ -4,12 +4,13 @@ import { i18n } from "discourse-i18n";
export default class extends NotificationTypeBase {
get label() {
const nameOrUsername = this.siteSettings.prioritize_full_name_in_ux
- ? this.notification.data.display_name
+ ? this.notification.data.display_name ||
+ this.notification.data.display_username
: this.notification.data.display_username;
if (this.count === 2) {
const nameOrUsername2 = this.siteSettings.prioritize_full_name_in_ux
- ? this.notification.data.name2
+ ? this.notification.data.name2 || this.notification.data.username2
: this.notification.data.username2;
return i18n("notifications.liked_by_2_users", {