Skip to content

Commit e3c2a4b

Browse files
committed
Bug fix
1 parent 324f46c commit e3c2a4b

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,16 @@ public MainWindowViewModel(ISnackbarMessageQueue snackbarMessageQueue, Action<EV
261261
SelectedMoveToGroup = new();
262262
SelectedRouting = new();
263263
SelectedServer = new();
264-
if (_config.tunModeItem.enableTun && Utils.IsAdministrator())
264+
if (_config.tunModeItem.enableTun)
265265
{
266-
EnableTun = true;
266+
if (Utils.IsAdministrator())
267+
{
268+
EnableTun = true;
269+
}
270+
else
271+
{
272+
_config.tunModeItem.enableTun = EnableTun = false;
273+
}
267274
}
268275
_subId = _config.subIndexId;
269276

@@ -1502,7 +1509,7 @@ public void Reload()
15021509
Application.Current?.Dispatcher.Invoke((Action)(() =>
15031510
{
15041511
BlReloadEnabled = true;
1505-
}));
1512+
}));
15061513
});
15071514
}
15081515

@@ -1515,7 +1522,7 @@ await Task.Run(() =>
15151522
//ConfigHandler.SaveConfig(_config, false);
15161523

15171524
ChangeSystemProxyStatus(_config.sysProxyType, false);
1518-
});
1525+
});
15191526
}
15201527

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

15521559
Application.Current?.Dispatcher.Invoke((Action)(() =>
15531560
{

0 commit comments

Comments
 (0)