mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-08 15:47:40 +01:00
Updated guest user icon and bgColor
Due to the label for guests being translatable, the first character for guests was actually "[", causing their user icon to be "[" with a colour. This commit changes it to be a hardcoded question mark and with a grey background colour.
This commit is contained in:
@@ -105,6 +105,8 @@ module.exports = function(User) {
|
||||
user.username = '[[global:guest]]';
|
||||
user.userslug = '';
|
||||
user.picture = '';
|
||||
user['icon:text'] = '?';
|
||||
user['icon:bgColor'] = '#aaa';
|
||||
}
|
||||
|
||||
if (user.picture && user.picture === user.uploadedpicture) {
|
||||
@@ -118,7 +120,7 @@ module.exports = function(User) {
|
||||
}
|
||||
|
||||
// User Icons
|
||||
if (user.hasOwnProperty('picture') && user.username) {
|
||||
if (user.hasOwnProperty('picture') && user.username && parseInt(user.uid, 10)) {
|
||||
user['icon:text'] = (user.username[0] || '').toUpperCase();
|
||||
user['icon:bgColor'] = iconBackgrounds[Array.prototype.reduce.call(user.username, function(cur, next) {
|
||||
return cur + next.charCodeAt();
|
||||
|
||||
Reference in New Issue
Block a user