mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 14:13:38 -05:00
Merge pull request #1501 from sharelatex/cmg-anonymous-display-name
Label only truly anonymous users as anonymous GitOrigin-RevId: c33a5c0584bd8a0603921fcf1579204b5fcac009
This commit is contained in:
parent
9abea8ae5f
commit
b1c40d2c58
1 changed files with 8 additions and 2 deletions
|
@ -101,8 +101,14 @@ define([
|
||||||
user.doc = this.ide.fileTreeManager.findEntityById(user.doc_id)
|
user.doc = this.ide.fileTreeManager.findEntityById(user.doc_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((user.name != null ? user.name.trim().length : undefined) === 0) {
|
// If the user's name is empty use their email as display name
|
||||||
user.name = user.email.trim()
|
// Otherwise they're probably an anonymous user
|
||||||
|
if (user.name === null || user.name.trim().length === 0) {
|
||||||
|
if (user.email) {
|
||||||
|
user.name = user.email.trim()
|
||||||
|
} else if (user.user_id === 'anonymous-user') {
|
||||||
|
user.name = 'Anonymous'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
user.initial = user.name != null ? user.name[0] : undefined
|
user.initial = user.name != null ? user.name[0] : undefined
|
||||||
|
|
Loading…
Reference in a new issue