@@ -54,7 +54,7 @@ import net.mullvad.mullvadvpn.R
54
54
import net.mullvad.mullvadvpn.compose.cell.FilterCell
55
55
import net.mullvad.mullvadvpn.compose.cell.HeaderCell
56
56
import net.mullvad.mullvadvpn.compose.cell.IconCell
57
- import net.mullvad.mullvadvpn.compose.cell.NormalRelayLocationCell
57
+ import net.mullvad.mullvadvpn.compose.cell.StatusRelayLocationCell
58
58
import net.mullvad.mullvadvpn.compose.cell.SwitchComposeSubtitleCell
59
59
import net.mullvad.mullvadvpn.compose.cell.ThreeDotCell
60
60
import net.mullvad.mullvadvpn.compose.communication.CustomListAction
@@ -286,9 +286,7 @@ fun SelectLocationScreen(
286
286
}
287
287
}
288
288
}
289
- var bottomSheetState by remember {
290
- mutableStateOf<BottomSheetState >(BottomSheetState .Hidden )
291
- }
289
+ var bottomSheetState by remember { mutableStateOf<BottomSheetState ?>(null ) }
292
290
LazyColumn (
293
291
modifier =
294
292
Modifier .fillMaxSize()
@@ -349,7 +347,7 @@ fun SelectLocationScreen(
349
347
onEditCustomListName = onEditCustomListName,
350
348
onEditLocationsCustomList = onEditLocationsCustomList,
351
349
onDeleteCustomList = onDeleteCustomList,
352
- onHideBottomSheet = { bottomSheetState = BottomSheetState . Hidden }
350
+ onHideBottomSheet = { bottomSheetState = null }
353
351
)
354
352
}
355
353
}
@@ -383,7 +381,7 @@ private fun LazyListScope.customLists(
383
381
key = { item -> item.code },
384
382
contentType = { ContentType .ITEM },
385
383
) { customList ->
386
- NormalRelayLocationCell (
384
+ StatusRelayLocationCell (
387
385
relay = customList,
388
386
// Do not show selection for locations in custom lists
389
387
selectedItem = selectedItem as ? RelayItem .CustomList ,
@@ -425,7 +423,7 @@ private fun LazyListScope.relayList(
425
423
key = { item -> item.code },
426
424
contentType = { ContentType .ITEM },
427
425
) { country ->
428
- NormalRelayLocationCell (
426
+ StatusRelayLocationCell (
429
427
relay = country,
430
428
selectedItem = selectedItem,
431
429
onSelectRelay = onSelectRelay,
@@ -437,7 +435,7 @@ private fun LazyListScope.relayList(
437
435
438
436
@Composable
439
437
private fun BottomSheets (
440
- bottomSheetState : BottomSheetState ,
438
+ bottomSheetState : BottomSheetState ? ,
441
439
onCreateCustomList : (RelayItem ? ) -> Unit ,
442
440
onEditCustomLists : () -> Unit ,
443
441
onAddLocationToList : (RelayItem , RelayItem .CustomList ) -> Unit ,
@@ -473,7 +471,7 @@ private fun BottomSheets(
473
471
closeBottomSheet = onHideBottomSheet
474
472
)
475
473
}
476
- BottomSheetState . Hidden -> {
474
+ null -> {
477
475
/* Do nothing */
478
476
}
479
477
}
@@ -710,7 +708,6 @@ private const val EXTRA_ITEMS_LOCATION = 3
710
708
private const val EXTRA_ITEM_CUSTOM_LIST = 1
711
709
712
710
sealed interface BottomSheetState {
713
- data object Hidden : BottomSheetState
714
711
715
712
data class ShowCustomListsBottomSheet (val editListEnabled : Boolean ) : BottomSheetState
716
713
0 commit comments