From 5ea67840f891e447836d5bfc97a9d0dd711afe5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Wed, 13 Nov 2024 10:43:42 +0800 Subject: [PATCH] Fix log crash --- app/src/main/java/io/nekohasekai/sfa/ui/main/LogFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/io/nekohasekai/sfa/ui/main/LogFragment.kt b/app/src/main/java/io/nekohasekai/sfa/ui/main/LogFragment.kt index 7c5230e..2ae6da0 100644 --- a/app/src/main/java/io/nekohasekai/sfa/ui/main/LogFragment.kt +++ b/app/src/main/java/io/nekohasekai/sfa/ui/main/LogFragment.kt @@ -139,12 +139,12 @@ class LogFragment : Fragment(), CommandClient.Handler { lifecycleScope.launch(Dispatchers.Main) { val messageLen = messageList.size val removeLen = logList.size + messageLen - 300 + logList.addAll(messageList) if (removeLen > 0) { repeat(removeLen) { logList.removeFirst() } } - logList.addAll(messageList) updateViews(removeLen, messageLen) } }