Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Sep 5, 2024
1 parent 14afeab commit c83dce3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions v2rayN/ServiceLib/Handler/NoticeHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ public void SendMessage(string? content)
MessageBus.Current.SendMessage(content, Global.CommandSendMsgView);
}

public void SendMessage(string? content, bool time)
public void SendMessageEx(string? content )
{
if (content.IsNullOrEmpty())
{
return;
}
content = $"{DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")} {content}";
content = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss} {content}";
SendMessage(content);
}

Expand Down
2 changes: 1 addition & 1 deletion v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private void DoSortingSelected(bool c)

private void UpdateHandler(bool notify, string msg)
{
_noticeHandler?.SendMessage(msg, true);
_noticeHandler?.SendMessageEx(msg);
}

public void ProxiesReload()
Expand Down
8 changes: 4 additions & 4 deletions v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ private void UpdateHandler(bool notify, string msg)

private void UpdateTaskHandler(bool success, string msg)
{
_noticeHandler?.SendMessage(msg);
_noticeHandler?.SendMessageEx(msg);
if (success)
{
var indexIdOld = _config.indexId;
Expand Down Expand Up @@ -631,7 +631,7 @@ public void TestServerAvailability()
}
(new UpdateHandler()).RunAvailabilityCheck(async (bool success, string msg) =>
{
_noticeHandler?.SendMessage(msg, true);
_noticeHandler?.SendMessageEx(msg);
if (!_config.uiItem.showInTaskbar)
{
Expand Down Expand Up @@ -881,7 +881,7 @@ public void SetListenerType(ESysProxyType type)
private async Task ChangeSystemProxyStatusAsync(ESysProxyType type, bool blChange)
{
await _updateView?.Invoke(EViewAction.UpdateSysProxy, _config.tunModeItem.enableTun ? true : false);
_noticeHandler?.SendMessage($"{ResUI.TipChangeSystemProxy} - {_config.systemProxyItem.sysProxyType.ToString()}", true);
_noticeHandler?.SendMessageEx($"{ResUI.TipChangeSystemProxy} - {_config.systemProxyItem.sysProxyType.ToString()}");

BlSystemProxyClear = (type == ESysProxyType.ForcedClear);
BlSystemProxySet = (type == ESysProxyType.ForcedChange);
Expand Down Expand Up @@ -941,7 +941,7 @@ private async Task RoutingSelectedChangedAsync(bool c)

if (ConfigHandler.SetDefaultRouting(_config, item) == 0)
{
_noticeHandler?.SendMessage(ResUI.TipChangeRouting, true);
_noticeHandler?.SendMessageEx(ResUI.TipChangeRouting);
Reload();
await _updateView?.Invoke(EViewAction.DispatcherRefreshIcon, null);
}
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public void SetSpeedTestResult(SpeedTestResult result)
{
if (Utils.IsNullOrEmpty(result.IndexId))
{
_noticeHandler?.SendMessage(result.Delay, true);
_noticeHandler?.SendMessageEx(result.Delay);
_noticeHandler?.Enqueue(result.Delay);
return;
}
Expand Down

0 comments on commit c83dce3

Please sign in to comment.