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 noteEvent = noteState.note.event
val name = val name =
if (noteEvent is PeopleListEvent) { when (noteEvent) {
noteEvent.nameOrTitle() ?: option.note.dTag() is PeopleListEvent -> {
} else if (noteEvent is FollowListEvent) { noteEvent.nameOrTitle() ?: option.note.dTag()
noteEvent.title() ?: option.note.dTag() }
} else {
option.note.dTag() is FollowListEvent -> {
noteEvent.title() ?: option.note.dTag()
}
else -> {
option.note.dTag()
}
} }
Text(text = name, color = MaterialTheme.colorScheme.onSurface) Text(text = name, color = MaterialTheme.colorScheme.onSurface)
@@ -278,7 +284,7 @@ fun RenderOption(
) { ) {
val it by observeNote(option.note, accountViewModel) 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( TextSpinner(
placeholder = conditionTypes.filter { it.first == postViewModel.condition }.first().second, placeholder = conditionTypes.first { it.first == postViewModel.condition }.second,
options = conditionOptions, options = conditionOptions,
onSelect = { onSelect = {
postViewModel.updateCondition(conditionTypes[it].first) postViewModel.updateCondition(conditionTypes[it].first)