Show clash ui when tun enabled (#9010)

This commit is contained in:
DHR60 2026-03-30 12:09:10 +00:00 committed by GitHub
parent 2caf8ea14f
commit 01c85adedf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View file

@ -1432,7 +1432,7 @@ public static class ConfigHandler
else if (node.ConfigType == EConfigType.Custom else if (node.ConfigType == EConfigType.Custom
&& node.PreSocksPort is > 0 and <= 65535) && node.PreSocksPort is > 0 and <= 65535)
{ {
var preCoreType = AppManager.Instance.RunningCoreType = config.TunModeItem.EnableTun ? ECoreType.sing_box : ECoreType.Xray; var preCoreType = config.TunModeItem.EnableTun ? ECoreType.sing_box : ECoreType.Xray;
itemSocks = new ProfileItem() itemSocks = new ProfileItem()
{ {
CoreType = preCoreType, CoreType = preCoreType,

View file

@ -90,6 +90,9 @@ public class CoreManager
await CoreStart(mainContext); await CoreStart(mainContext);
await CoreStartPreService(preContext); await CoreStartPreService(preContext);
AppManager.Instance.RunningCoreType = preContext?.RunCoreType ?? mainContext.RunCoreType;
if (_processService != null) if (_processService != null)
{ {
await UpdateFunc(true, $"{node.GetSummary()}"); await UpdateFunc(true, $"{node.GetSummary()}");
@ -172,7 +175,7 @@ public class CoreManager
private async Task CoreStart(CoreConfigContext context) private async Task CoreStart(CoreConfigContext context)
{ {
var node = context.Node; var node = context.Node;
var coreType = AppManager.Instance.RunningCoreType = AppManager.Instance.GetCoreType(node, node.ConfigType); var coreType = AppManager.Instance.GetCoreType(node, node.ConfigType);
var coreInfo = CoreInfoManager.Instance.GetCoreInfo(coreType); var coreInfo = CoreInfoManager.Instance.GetCoreInfo(coreType);
var displayLog = node.ConfigType != EConfigType.Custom || node.DisplayLog; var displayLog = node.ConfigType != EConfigType.Custom || node.DisplayLog;