diff --git a/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs b/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs index e0af705d..70de9685 100644 --- a/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs @@ -104,6 +104,18 @@ namespace ServiceLib.ViewModels public StatusBarViewModel(Func>? updateView) { _config = AppHandler.Instance.Config; + SelectedRouting = new(); + SelectedServer = new(); + RunningServerToolTipText = "-"; + + if (_config.TunModeItem.EnableTun && AppHandler.Instance.IsAdministrator) + { + EnableTun = true; + } + else + { + _config.TunModeItem.EnableTun = EnableTun = false; + } #region WhenAnyValue && ReactiveCommand @@ -179,19 +191,6 @@ namespace ServiceLib.ViewModels private async Task Init() { - SelectedRouting = new(); - SelectedServer = new(); - RunningServerToolTipText = "-"; - - if (_config.TunModeItem.EnableTun && AppHandler.Instance.IsAdministrator) - { - EnableTun = true; - } - else - { - _config.TunModeItem.EnableTun = EnableTun = false; - } - await RefreshRoutingsMenu(); await InboundDisplayStatus(); await ChangeSystemProxyAsync(_config.SystemProxyItem.SysProxyType, true);