mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Correct className for notification avatars using system avatar (#25578)
This commit is contained in:
parent
090252bc39
commit
13186e6790
@ -42,11 +42,18 @@ export default class UserMenuBaseItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get iconComponentArgs() {
|
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 {
|
return {
|
||||||
avatarTemplate:
|
avatarTemplate:
|
||||||
this.avatarTemplate || this.site.system_user_avatar_template,
|
this.avatarTemplate || this.site.system_user_avatar_template,
|
||||||
icon: this.icon,
|
icon: this.icon,
|
||||||
classNames: this.avatarTemplate ? "user-avatar" : "system-avatar",
|
classNames: usingSystemAvatar ? "system-avatar" : "user-avatar",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user