merge
This commit is contained in:
commit
4e0034124b
@ -40,7 +40,11 @@ const getAvatarColour = (name: string) => {
|
|||||||
'#7F3BF5',
|
'#7F3BF5',
|
||||||
'#8F959E'
|
'#8F959E'
|
||||||
]
|
]
|
||||||
let charIndex = name ? pinyin(name).charAt(0).toUpperCase().charCodeAt(0) - 65 : 0
|
let charIndex = name
|
||||||
|
? pinyin(name).charAt(0).toUpperCase().charCodeAt(0) - 65 >= 0
|
||||||
|
? pinyin(name).charAt(0).toUpperCase().charCodeAt(0) - 65
|
||||||
|
: 0
|
||||||
|
: 0
|
||||||
|
|
||||||
function getColor() {
|
function getColor() {
|
||||||
return colours[Math.abs(charIndex % colours.length)]
|
return colours[Math.abs(charIndex % colours.length)]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user