mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-10-12 04:39:05 +02:00
fix: fallback to username if chars in name are not supported for avatars
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
"github.com/go-webauthn/webauthn/webauthn"
|
||||
|
||||
datatype "github.com/pocket-id/pocket-id/backend/internal/model/types"
|
||||
"github.com/pocket-id/pocket-id/backend/internal/utils"
|
||||
)
|
||||
|
||||
type User struct {
|
||||
@@ -88,16 +87,6 @@ func (u User) FullName() string {
|
||||
return u.Username
|
||||
}
|
||||
|
||||
func (u User) Initials() string {
|
||||
first := utils.GetFirstCharacter(u.FirstName)
|
||||
last := utils.GetFirstCharacter(u.LastName)
|
||||
if first != "" || last != "" {
|
||||
return strings.ToUpper(first + last)
|
||||
}
|
||||
|
||||
return strings.ToUpper(utils.GetFirstCharacter(u.Username))
|
||||
}
|
||||
|
||||
func (u User) LastModified() time.Time {
|
||||
if u.UpdatedAt != nil {
|
||||
return u.UpdatedAt.ToTime()
|
||||
|
||||
Reference in New Issue
Block a user