mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-02-01 22:47:40 +00:00
feat(user): use name for initals avatar, not username
For external auth providers, the username might be randomly generated, which results in a random initial - this is unexpected and confusing for users.
This commit is contained in:
@@ -143,7 +143,7 @@ func getAvatarForUser(u *user.User) (fullSizeAvatar *image.RGBA64, err error) {
|
||||
|
||||
if !exists {
|
||||
log.Debugf("Initials avatar for user %d not cached, creating...", u.ID)
|
||||
firstRune := []rune(strings.ToUpper(u.Username))[0]
|
||||
firstRune := []rune(strings.ToUpper(u.Name))[0]
|
||||
bg := avatarBgColors[int(u.ID)%len(avatarBgColors)] // Random color based on the user id
|
||||
|
||||
fullSizeAvatar, err = drawImage(firstRune, bg)
|
||||
|
||||
Reference in New Issue
Block a user