mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-26 21:26:29 +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 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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -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)
|
||||||
|
Reference in New Issue
Block a user