From 11106937a35308b7a9f59ba54a95458d715a5f2c Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 29 Jan 2024 11:50:24 +0800 Subject: [PATCH] Improve --- v2rayN/v2rayN/Handler/CoreHandler.cs | 6 ++++++ v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs | 7 +++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/v2rayN/v2rayN/Handler/CoreHandler.cs b/v2rayN/v2rayN/Handler/CoreHandler.cs index ff30ab8b..bbd8cd2e 100644 --- a/v2rayN/v2rayN/Handler/CoreHandler.cs +++ b/v2rayN/v2rayN/Handler/CoreHandler.cs @@ -45,6 +45,12 @@ namespace v2rayN.Handler ShowMsg(false, msg); ShowMsg(true, $"{node.GetSummary()}"); CoreStop(); + + if (_config.tunModeItem.enableTun) + { + Thread.Sleep(1000); + } + CoreStart(node); //In tun mode, do a delay check and restart the core diff --git a/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs b/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs index 96c26562..78278658 100644 --- a/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs +++ b/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs @@ -862,13 +862,12 @@ namespace v2rayN.ViewModels var running = ConfigHandler.GetDefaultServer(_config); if (running != null) { - var runningSummary = running.GetSummary(); - RunningServerDisplay = $"{ResUI.menuServers}:{runningSummary}"; - RunningServerToolTipText = runningSummary; + RunningServerDisplay = + RunningServerToolTipText = running.GetSummary(); } else { - RunningServerDisplay = ResUI.CheckServerSettings; + RunningServerDisplay = RunningServerToolTipText = ResUI.CheckServerSettings; } }));