mirror of
https://github.com/SagerNet/sing-box-for-android.git
synced 2025-04-03 03:47:38 +03:00
Fix log crash
This commit is contained in:
parent
6b8b5562ae
commit
5ea67840f8
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue