Fix logs
This commit is contained in:
@@ -171,12 +171,14 @@ public class CommandClient: ObservableObject {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
DispatchQueue.main.async { [self] in
|
DispatchQueue.main.async { [self] in
|
||||||
if commandClient.logList.count >= commandClient.logMaxLines {
|
var newLogList = commandClient.logList
|
||||||
commandClient.logList.removeFirst()
|
|
||||||
}
|
|
||||||
while messageList.hasNext() {
|
while messageList.hasNext() {
|
||||||
commandClient.logList.append(messageList.next())
|
newLogList.append(messageList.next())
|
||||||
}
|
}
|
||||||
|
if newLogList.count >= commandClient.logMaxLines {
|
||||||
|
newLogList.removeSubrange(0...newLogList.count-commandClient.logMaxLines)
|
||||||
|
}
|
||||||
|
commandClient.logList = newLogList
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user