mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-25 16:40:58 -05:00
feat: render masquerade colour
This commit is contained in:
parent
62a427b7a7
commit
1a0b4b5703
1 changed files with 5 additions and 15 deletions
|
@ -55,7 +55,7 @@ export const Username = observer(
|
||||||
...otherProps
|
...otherProps
|
||||||
}: UsernameProps) => {
|
}: UsernameProps) => {
|
||||||
let username = user?.username;
|
let username = user?.username;
|
||||||
let color;
|
let color = masquerade?.colour;
|
||||||
|
|
||||||
if (user && showServerIdentity) {
|
if (user && showServerIdentity) {
|
||||||
const { server } = useParams<{ server?: string }>();
|
const { server } = useParams<{ server?: string }>();
|
||||||
|
@ -75,20 +75,10 @@ export const Username = observer(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const role = member.hoistedRole;
|
if (!color) {
|
||||||
if (role) {
|
for (const [_, { colour }] of member.orderedRoles) {
|
||||||
color = role[1].colour;
|
if (colour) {
|
||||||
}
|
color = colour;
|
||||||
|
|
||||||
if (member.roles && member.roles.length > 0) {
|
|
||||||
const srv = client.servers.get(member._id.server);
|
|
||||||
if (srv?.roles) {
|
|
||||||
for (const role of member.roles) {
|
|
||||||
const c = srv.roles[role]?.colour;
|
|
||||||
if (c) {
|
|
||||||
color = c;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue