Fix user avatar color order (#209)

This commit is contained in:
Luke Vella 2022-06-27 20:44:42 +01:00 committed by GitHub
parent 58472e3a2d
commit 000d105983
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -46,9 +46,7 @@ export const UserAvatarProvider: React.VoidFunctionComponent<{
"": defaultColor, "": defaultColor,
}; };
for (let i = 0; i < names.length; i++) { for (let i = 0; i < names.length; i++) {
const lastIndex = names.length - 1; const name = names[i].trim().toLowerCase();
// start from the end since the names is "most recent" first.
const name = names[lastIndex - i].trim().toLowerCase();
const color = colors[(seedValue + i) % colors.length]; const color = colors[(seedValue + i) % colors.length];
res[name] = color; res[name] = color;
} }