Skip to content

Commit

Permalink
fix: wrong service opens when clicking on search result [WPB-11330] 🍒 (…
Browse files Browse the repository at this point in the history
…#3477)

Co-authored-by: MichaĹ‚ Saleniuk <[email protected]>
Co-authored-by: MichaĹ‚ Saleniuk <[email protected]>
  • Loading branch information
3 people authored Oct 1, 2024
1 parent 8263054 commit 55caf88
Showing 1 changed file with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import com.wire.android.ui.common.dimensions
import com.wire.android.ui.common.progress.CenteredCircularProgressBarIndicator
import com.wire.android.ui.home.conversations.search.widget.SearchFailureBox
import com.wire.android.ui.home.newconversation.model.Contact
import com.wire.android.util.extension.folderWithElements
import kotlinx.collections.immutable.ImmutableList

@Composable
Expand Down Expand Up @@ -106,36 +107,35 @@ private fun SuccessServicesList(
modifier = Modifier
.weight(1f)
) {
services
.forEach {
item {
RowItemTemplate(
leadingIcon = {
Row {
UserProfileAvatar(it.avatarData)
}
},
titleStartPadding = dimensions().spacing0x,
title = {
Row(verticalAlignment = Alignment.CenterVertically) {
HighlightName(
name = it.name,
searchQuery = searchQuery,
modifier = Modifier.weight(weight = 1f, fill = false)
)
UserBadge(
membership = it.membership,
connectionState = it.connectionState,
startPadding = dimensions().spacing8x
)
}
},
actions = {},
clickable = remember { Clickable(enabled = true) { onServiceClicked(it) } },
modifier = Modifier.padding(start = dimensions().spacing8x)
)
}
}
folderWithElements(
items = services.associateBy { it.id }
) {
RowItemTemplate(
leadingIcon = {
Row {
UserProfileAvatar(it.avatarData)
}
},
titleStartPadding = dimensions().spacing0x,
title = {
Row(verticalAlignment = Alignment.CenterVertically) {
HighlightName(
name = it.name,
searchQuery = searchQuery,
modifier = Modifier.weight(weight = 1f, fill = false)
)
UserBadge(
membership = it.membership,
connectionState = it.connectionState,
startPadding = dimensions().spacing8x
)
}
},
actions = {},
clickable = remember(it) { Clickable(enabled = true) { onServiceClicked(it) } },
modifier = Modifier.padding(start = dimensions().spacing8x)
)
}
}
}
}

0 comments on commit 55caf88

Please sign in to comment.