fix: sort roles by rank in user sheet
Signed-off-by: Infi <wingit@geist.ga>
This commit is contained in:
parent
813b29fecd
commit
1b3429f447
|
|
@ -82,16 +82,18 @@ fun UserContextSheet(
|
||||||
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
) {
|
) {
|
||||||
it.forEach { roleId ->
|
it
|
||||||
val role = server?.roles?.get(roleId)
|
.map { roleId -> server?.roles?.get(roleId) }
|
||||||
role?.let {
|
.sortedBy { it?.rank ?: 0.0 }
|
||||||
RoleChip(
|
.forEach { role ->
|
||||||
label = role.name ?: roleId,
|
role?.let {
|
||||||
brush = role.colour?.let { WebCompat.parseColour(it) }
|
RoleChip(
|
||||||
?: Brush.solidColor(LocalContentColor.current)
|
label = role.name ?: "null",
|
||||||
)
|
brush = role.colour?.let { WebCompat.parseColour(it) }
|
||||||
|
?: Brush.solidColor(LocalContentColor.current)
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue