reduce warnings:

remove unused nav parameter
remove unnecessary ? operator
replace .filter().first() with .first
This commit is contained in:
davotoula
2025-08-23 17:08:17 +01:00
parent f3f8beeebe
commit 03483c932c
2 changed files with 14 additions and 8 deletions

View File

@@ -260,12 +260,18 @@ fun RenderOption(
val noteEvent = noteState.note.event
val name =
if (noteEvent is PeopleListEvent) {
noteEvent.nameOrTitle() ?: option.note.dTag()
} else if (noteEvent is FollowListEvent) {
noteEvent.title() ?: option.note.dTag()
} else {
option.note.dTag()
when (noteEvent) {
is PeopleListEvent -> {
noteEvent.nameOrTitle() ?: option.note.dTag()
}
is FollowListEvent -> {
noteEvent.title() ?: option.note.dTag()
}
else -> {
option.note.dTag()
}
}
Text(text = name, color = MaterialTheme.colorScheme.onSurface)
@@ -278,7 +284,7 @@ fun RenderOption(
) {
val it by observeNote(option.note, accountViewModel)
Text(text = "/n/${((it?.note as? AddressableNote)?.dTag() ?: "")}", color = MaterialTheme.colorScheme.onSurface)
Text(text = "/n/${((it.note as? AddressableNote)?.dTag() ?: "")}", color = MaterialTheme.colorScheme.onSurface)
}
}
}

View File

@@ -211,7 +211,7 @@ fun SellProduct(postViewModel: NewProductViewModel) {
}
TextSpinner(
placeholder = conditionTypes.filter { it.first == postViewModel.condition }.first().second,
placeholder = conditionTypes.first { it.first == postViewModel.condition }.second,
options = conditionOptions,
onSelect = {
postViewModel.updateCondition(conditionTypes[it].first)