mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-25 12:01:45 +02:00
reduce warnings:
remove unused nav parameter remove unnecessary ? operator replace .filter().first() with .first
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user