Skip to content

Commit

Permalink
fix: use a certain index instead of itemKey function
Browse files Browse the repository at this point in the history
  • Loading branch information
kenkoro committed Apr 21, 2024
1 parent 5a800ad commit 13838bb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ object Urls {
private const val KTOR_LOCALHOST = "ktor-backend.loca.lt"
private const val LOCALHOST = "10.10.65.179"
private const val LOCALHOST_PHONE = "192.168.224.149"
const val HOST = LOCALHOST_PHONE
const val HOST = LOCALHOST
const val PORT = 8080

object User {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import com.kenkoro.taurus.client.feature.sewing.domain.model.Order
import com.kenkoro.taurus.client.feature.sewing.domain.model.User
import kotlinx.coroutines.launch

private fun getOrderKey(order: Order): Int = order.orderId

@Composable
fun OrderContent(
orders: LazyPagingItems<Order>,
Expand Down Expand Up @@ -59,7 +61,10 @@ fun OrderContent(
item {
Spacer(modifier = Modifier.height(contentHeight.large))
}
items(count = orders.itemCount) { index ->
items(
count = orders.itemCount,
key = { index -> orders[index]?.orderId ?: 0 },
) { index ->
val order = orders[index]
if (order != null) {
OrderItem(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,6 @@ fun OrderItem(
} catch (e: Exception) {
Log.d("kenkoro", e.message!!)
}

visible = true
clicked = false
}

launch {
Expand Down

0 comments on commit 13838bb

Please sign in to comment.