mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix: DropDownPreference exception when item is not found
This commit is contained in:
parent
aa84d47375
commit
54b59fdb97
1 changed files with 4 additions and 1 deletions
|
|
@ -16,8 +16,10 @@ import androidx.compose.runtime.remember
|
|||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import com.geeksville.mesh.R
|
||||
import com.google.protobuf.ProtocolMessageEnum
|
||||
|
||||
@Composable
|
||||
|
|
@ -48,7 +50,8 @@ fun <T> DropDownPreference(
|
|||
|
||||
RegularPreference(
|
||||
title = title,
|
||||
subtitle = items.first { it.first == selectedItem }.second,
|
||||
subtitle = items.find { it.first == selectedItem }?.second
|
||||
?: stringResource(id = R.string.unrecognized),
|
||||
onClick = {
|
||||
dropDownExpanded = true
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue