Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
1 parent
8f14aca647
commit
b9814e04c6
1 file changed
+10
-2
@@ -190,14 +190,22 @@ fun ModelScreen(
|
|||||||
)
|
)
|
||||||
|
|
||||||
val models = provider.models.orEmpty()
|
val models = provider.models.orEmpty()
|
||||||
if (models.isEmpty()) {
|
val filteredModels =
|
||||||
|
if (query.isBlank()) {
|
||||||
|
models
|
||||||
|
} else {
|
||||||
|
models.filter {
|
||||||
|
it.contains(query, ignoreCase = true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (filteredModels.isEmpty()) {
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.model_no_models),
|
text = stringResource(R.string.model_no_models),
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
models.forEach { model ->
|
filteredModels.forEach { model ->
|
||||||
val isActive =
|
val isActive =
|
||||||
state.activeProfile?.provider == provider.slug &&
|
state.activeProfile?.provider == provider.slug &&
|
||||||
state.activeProfile?.model == model
|
state.activeProfile?.model == model
|
||||||
|
|||||||
Reference in new issue
Block a user