fix: ui tweaks (#4696)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich 2026-03-03 09:37:40 -06:00 committed by GitHub
parent 657553f830
commit c234ace312
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 258 additions and 247 deletions

View file

@ -25,7 +25,13 @@ fun getString(stringResource: StringResource): String = runBlocking { composeGet
/** Retrieves a formatted string from the [StringResource] in a blocking manner. */
fun getString(stringResource: StringResource, vararg formatArgs: Any): String = runBlocking {
composeGetString(stringResource, *formatArgs)
val pattern = composeGetString(stringResource)
if (formatArgs.isNotEmpty()) {
@Suppress("SpreadOperator")
pattern.format(*formatArgs)
} else {
pattern
}
}
/** Retrieves a string from the [StringResource] in a suspending manner. */
@ -44,6 +50,11 @@ suspend fun getStringSuspend(stringResource: StringResource, vararg formatArgs:
}
.toTypedArray()
@Suppress("SpreadOperator")
return composeGetString(stringResource, *resolvedArgs)
val pattern = composeGetString(stringResource)
return if (resolvedArgs.isNotEmpty()) {
@Suppress("SpreadOperator")
pattern.format(*resolvedArgs)
} else {
pattern
}
}