mirror of
https://github.com/SagerNet/sing-box-for-android.git
synced 2025-04-03 20:07: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) {
|
lifecycleScope.launch(Dispatchers.Main) {
|
||||||
val messageLen = messageList.size
|
val messageLen = messageList.size
|
||||||
val removeLen = logList.size + messageLen - 300
|
val removeLen = logList.size + messageLen - 300
|
||||||
|
logList.addAll(messageList)
|
||||||
if (removeLen > 0) {
|
if (removeLen > 0) {
|
||||||
repeat(removeLen) {
|
repeat(removeLen) {
|
||||||
logList.removeFirst()
|
logList.removeFirst()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logList.addAll(messageList)
|
|
||||||
updateViews(removeLen, messageLen)
|
updateViews(removeLen, messageLen)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue