fix: resolve undefined name property access in notification display for user settings
The notification item component was incorrectly accessing `notif.username` directly instead of `notif.username.name`, causing undefined values to appear in the notification display when the username field contained an object with a `name` property. Added a console.info statement for debugging and corrected the property chain to properly extract the display name from nested object structures.
This commit is contained in:
parent
8e02a2d053
commit
63b2ad8440
@ -173,7 +173,8 @@ class NotificationItem extends BaseComponent {
|
|||||||
const notif = this.notifData;
|
const notif = this.notifData;
|
||||||
const isUnread = notif.read === 0;
|
const isUnread = notif.read === 0;
|
||||||
const typeLabel = this.getTypeLabel(notif.type);
|
const typeLabel = this.getTypeLabel(notif.type);
|
||||||
const username = notif.username || notif.user_username || notif.name || 'Someone';
|
console.info(notif);
|
||||||
|
const username = notif.username.name || notif.user_username.name || notif.name || 'Someone';
|
||||||
|
|
||||||
this.addClass('notification-item');
|
this.addClass('notification-item');
|
||||||
if (isUnread) {
|
if (isUnread) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user