fix: prevent LazyColumn crash on duplicate timestamps in V2X topic detail view
This commit is contained in:
@@ -18,6 +18,7 @@ import androidx.compose.foundation.layout.size
|
|||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.width
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
import androidx.compose.foundation.lazy.items
|
import androidx.compose.foundation.lazy.items
|
||||||
|
import androidx.compose.foundation.lazy.itemsIndexed
|
||||||
import androidx.compose.foundation.lazy.rememberLazyListState
|
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
@@ -329,7 +330,7 @@ private fun MessageDetailPane(
|
|||||||
}
|
}
|
||||||
|
|
||||||
LazyColumn(state = listState, modifier = Modifier.fillMaxSize()) {
|
LazyColumn(state = listState, modifier = Modifier.fillMaxSize()) {
|
||||||
items(reversed, key = { "${it.topic}-${it.timestamp}" }) { msg ->
|
itemsIndexed(reversed, key = { index, msg -> "${msg.topic}-${msg.timestamp}-$index" }) { _, msg ->
|
||||||
MessageRow(msg)
|
MessageRow(msg)
|
||||||
HorizontalDivider(color = MaterialTheme.colorScheme.outline.copy(alpha = 0.2f))
|
HorizontalDivider(color = MaterialTheme.colorScheme.outline.copy(alpha = 0.2f))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user