mirror of
https://github.com/2dust/v2rayN.git
synced 2026-04-16 04:25:45 +00:00
Compare commits
2 commits
be311ddb19
...
5c4761697f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5c4761697f | ||
|
|
eb0ef90ed2 |
1 changed files with 13 additions and 3 deletions
|
|
@ -86,15 +86,25 @@ public class MsgViewModel : MyReactiveObject
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_queueMsg.Enqueue(ex.Message);
|
||||
EnqueueWithLimit(ex.Message);
|
||||
_lastMsgFilterNotAvailable = true;
|
||||
}
|
||||
}
|
||||
|
||||
_queueMsg.Enqueue(msg);
|
||||
EnqueueWithLimit(msg);
|
||||
if (!msg.EndsWith(Environment.NewLine))
|
||||
{
|
||||
_queueMsg.Enqueue(Environment.NewLine);
|
||||
EnqueueWithLimit(Environment.NewLine);
|
||||
}
|
||||
}
|
||||
|
||||
private void EnqueueWithLimit(string item)
|
||||
{
|
||||
_queueMsg.Enqueue(item);
|
||||
|
||||
while (_queueMsg.Count > NumMaxMsg)
|
||||
{
|
||||
_queueMsg.TryDequeue(out _);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue