From c83dce3cc08c03de0158c511e07847ed89ddfe92 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Thu, 5 Sep 2024 10:02:26 +0800 Subject: [PATCH] Fix https://github.com/2dust/v2rayN/issues/5644 --- v2rayN/ServiceLib/Handler/NoticeHandler.cs | 4 ++-- v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs | 2 +- v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs | 8 ++++---- v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/v2rayN/ServiceLib/Handler/NoticeHandler.cs b/v2rayN/ServiceLib/Handler/NoticeHandler.cs index ec7e3333..912eda15 100644 --- a/v2rayN/ServiceLib/Handler/NoticeHandler.cs +++ b/v2rayN/ServiceLib/Handler/NoticeHandler.cs @@ -22,13 +22,13 @@ namespace ServiceLib.Handler 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); } diff --git a/v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs b/v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs index 5fb095c1..2992c3a6 100644 --- a/v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs @@ -135,7 +135,7 @@ namespace ServiceLib.ViewModels private void UpdateHandler(bool notify, string msg) { - _noticeHandler?.SendMessage(msg, true); + _noticeHandler?.SendMessageEx(msg); } public void ProxiesReload() diff --git a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs index 7651f25c..43734d2e 100644 --- a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs @@ -391,7 +391,7 @@ namespace ServiceLib.ViewModels private void UpdateTaskHandler(bool success, string msg) { - _noticeHandler?.SendMessage(msg); + _noticeHandler?.SendMessageEx(msg); if (success) { var indexIdOld = _config.indexId; @@ -631,7 +631,7 @@ namespace ServiceLib.ViewModels } (new UpdateHandler()).RunAvailabilityCheck(async (bool success, string msg) => { - _noticeHandler?.SendMessage(msg, true); + _noticeHandler?.SendMessageEx(msg); if (!_config.uiItem.showInTaskbar) { @@ -881,7 +881,7 @@ namespace ServiceLib.ViewModels 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); @@ -941,7 +941,7 @@ namespace ServiceLib.ViewModels if (ConfigHandler.SetDefaultRouting(_config, item) == 0) { - _noticeHandler?.SendMessage(ResUI.TipChangeRouting, true); + _noticeHandler?.SendMessageEx(ResUI.TipChangeRouting); Reload(); await _updateView?.Invoke(EViewAction.DispatcherRefreshIcon, null); } diff --git a/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs b/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs index 88abe2d7..14e79a9b 100644 --- a/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs @@ -258,7 +258,7 @@ namespace ServiceLib.ViewModels { if (Utils.IsNullOrEmpty(result.IndexId)) { - _noticeHandler?.SendMessage(result.Delay, true); + _noticeHandler?.SendMessageEx(result.Delay); _noticeHandler?.Enqueue(result.Delay); return; }