android, desktop: lower limit of terminal items for non-developers (#3763)

This commit is contained in:
Stanislav Dmitrenko 2024-01-27 01:14:53 +07:00 committed by GitHub
parent 0e585d5e5b
commit 6b8fc6fdcf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -642,7 +642,8 @@ object ChatModel {
}
fun addTerminalItem(item: TerminalItem) {
if (terminalItems.value.size >= 500) {
val maxItems = if (appPreferences.developerTools.get()) 500 else 200
if (terminalItems.value.size >= maxItems) {
terminalItems.value = terminalItems.value.subList(1, terminalItems.value.size)
}
terminalItems.value += item