2dust 4 weeks ago
parent
commit
fb92b90d5c
  1. 25
      v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs

25
v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs

@ -104,6 +104,18 @@ namespace ServiceLib.ViewModels
public StatusBarViewModel(Func<EViewAction, object?, Task<bool>>? 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);

Loading…
Cancel
Save