Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Jun 28, 2024
1 parent 324f46c commit e3c2a4b
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,16 @@ public MainWindowViewModel(ISnackbarMessageQueue snackbarMessageQueue, Action<EV
SelectedMoveToGroup = new();
SelectedRouting = new();
SelectedServer = new();
if (_config.tunModeItem.enableTun && Utils.IsAdministrator())
if (_config.tunModeItem.enableTun)
{
EnableTun = true;
if (Utils.IsAdministrator())
{
EnableTun = true;
}
else
{
_config.tunModeItem.enableTun = EnableTun = false;
}
}
_subId = _config.subIndexId;

Expand Down Expand Up @@ -1502,7 +1509,7 @@ public void Reload()
Application.Current?.Dispatcher.Invoke((Action)(() =>
{
BlReloadEnabled = true;
}));
}));
});
}

Expand All @@ -1515,7 +1522,7 @@ await Task.Run(() =>
//ConfigHandler.SaveConfig(_config, false);
ChangeSystemProxyStatus(_config.sysProxyType, false);
});
});
}

private void CloseCore()
Expand Down Expand Up @@ -1547,7 +1554,7 @@ public void SetListenerType(ESysProxyType type)
private void ChangeSystemProxyStatus(ESysProxyType type, bool blChange)
{
SysProxyHandle.UpdateSysProxy(_config, _config.tunModeItem.enableTun ? true : false);
_noticeHandler?.SendMessage(ResUI.TipChangeSystemProxy + _config.sysProxyType.ToString(), true);
_noticeHandler?.SendMessage($"{ResUI.TipChangeSystemProxy} - {_config.sysProxyType.ToString()}", true);

Application.Current?.Dispatcher.Invoke((Action)(() =>
{
Expand Down

1 comment on commit e3c2a4b

@KattyZheng
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么我还是上不了,更新好第一次登陆OK,接着又是什么CORE有问题

Please sign in to comment.