FIX: Correct className for notification avatars using system avatar (#25578)

This commit is contained in:
Mark VanLandingham 2024-02-06 14:47:35 -06:00 committed by GitHub
parent 090252bc39
commit 13186e6790
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -42,11 +42,18 @@ export default class UserMenuBaseItem {
}
get iconComponentArgs() {
// Use endsWith to determine if the avatarTemplate is the system avatar, because locally the
// system avatar is a relative path and doesn't contain hostname. Exact matches will also
// evaluate to true.
const usingSystemAvatar =
!this.avatarTemplate ||
this.avatarTemplate.endsWith(this.site.system_user_avatar_template);
return {
avatarTemplate:
this.avatarTemplate || this.site.system_user_avatar_template,
icon: this.icon,
classNames: this.avatarTemplate ? "user-avatar" : "system-avatar",
classNames: usingSystemAvatar ? "system-avatar" : "user-avatar",
};
}