fix: issue where channels didn't load on start in sidebar
Signed-off-by: Infi <infi@infi.sh>
This commit is contained in:
parent
fac7411eea
commit
dda4ec0631
|
|
@ -139,12 +139,10 @@ fun RowScope.ChannelList(
|
||||||
.sortedBy { it.lastMessageID ?: it.id }
|
.sortedBy { it.lastMessageID ?: it.id }
|
||||||
.reversed()
|
.reversed()
|
||||||
|
|
||||||
val server = remember(serverId, RevoltAPI.serverCache) { RevoltAPI.serverCache[serverId] }
|
val server = RevoltAPI.serverCache[serverId]
|
||||||
val categorisedChannels = remember(server, RevoltAPI.channelCache) {
|
val categorisedChannels = server?.let {
|
||||||
server?.let {
|
|
||||||
ChannelUtils.categoriseServerFlat(it)
|
ChannelUtils.categoriseServerFlat(it)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Surface(
|
Surface(
|
||||||
tonalElevation = 1.dp,
|
tonalElevation = 1.dp,
|
||||||
|
|
@ -485,7 +483,7 @@ fun RowScope.ChannelList(
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
items(
|
items(
|
||||||
categorisedChannels.size ?: 0,
|
categorisedChannels.size,
|
||||||
key = { index ->
|
key = { index ->
|
||||||
val channel = categorisedChannels.getOrNull(index)
|
val channel = categorisedChannels.getOrNull(index)
|
||||||
channel?.let {
|
channel?.let {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue