Skip to content

Commit 3eb665f

Browse files
committed
Fix index of selected relay item function
1 parent 30fdf70 commit 3eb665f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt

+2-5
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,7 @@ fun SelectLocationScreen(
175175
uiState.relayListState.selectedItem != null
176176
) {
177177
LaunchedEffect(uiState.relayListState.selectedItem) {
178-
val index =
179-
uiState.relayListState.indexOfSelectedRelayItem(
180-
uiState.relayListState.selectedItem
181-
)
178+
val index = uiState.relayListState.indexOfSelectedRelayItem()
182179

183180
if (index >= 0) {
184181
lazyListState.scrollToItem(index)
@@ -278,7 +275,7 @@ private fun LazyListScope.relayList(
278275
}
279276
}
280277

281-
private fun RelayListState.RelayList.indexOfSelectedRelayItem(selectedItem: RelayItem?): Int =
278+
private fun RelayListState.RelayList.indexOfSelectedRelayItem(): Int =
282279
countries.indexOfFirst { relayCountry ->
283280
relayCountry.location.location.country ==
284281
when (selectedItem) {

0 commit comments

Comments
 (0)