Fix activity node display

pull/3165/head
2dust 2023-01-31 13:25:52 +08:00
parent 703e17478d
commit 84b91e9649
2 changed files with 6 additions and 7 deletions

View File

@ -85,8 +85,7 @@ namespace v2rayN.Handler
public List<ProfileItemModel> ProfileItems(string subid, string filter)
{
var sql = @$"select a.*
,b.remarks subRemarks
,case when a.indexId = '{_config.indexId}' then true else false end isActive
,b.remarks subRemarks
from ProfileItem a
left join SubItem b on a.subid = b.id
where 1=1 ";

View File

@ -684,6 +684,8 @@ namespace v2rayN.ViewModels
List<ProfileItemModel> lstModel = LazyConfig.Instance.ProfileItems(_subId, _serverFilter);
_lstProfile = Utils.FromJson<List<ProfileItem>>(Utils.ToJson(lstModel));
ConfigHandler.SetDefaultServer(_config, _lstProfile);
List<ServerStatItem> lstServerStat = new();
if (_statistics != null && _statistics.Enable)
{
@ -704,7 +706,7 @@ namespace v2rayN.ViewModels
network = t.network,
streamSecurity = t.streamSecurity,
subRemarks = t.subRemarks,
isActive = t.isActive,
isActive = t.indexId == _config.indexId,
delay = t.delay,
delayVal = t.delay != 0 ? $"{t.delay} {Global.DelayUnit}" : string.Empty,
speedVal = t.speed != 0 ? $"{t.speed} {Global.SpeedUnit}" : string.Empty,
@ -714,8 +716,6 @@ namespace v2rayN.ViewModels
totalUp = t22 == null ? "" : Utils.HumanFy(t22.totalUp)
}).ToList();
ConfigHandler.SetDefaultServer(_config, _lstProfile);
Application.Current.Dispatcher.Invoke((Action)(() =>
{
_profileItems.Clear();
@ -1134,7 +1134,7 @@ namespace v2rayN.ViewModels
if (sb.Length > 0)
{
Utils.SetClipboardData(sb.ToString());
_noticeHandler?.Enqueue(ResUI.BatchExportURLSuccessfully);
_noticeHandler?.SendMessage(ResUI.BatchExportURLSuccessfully);
}
}
@ -1159,7 +1159,7 @@ namespace v2rayN.ViewModels
if (sb.Length > 0)
{
Utils.SetClipboardData(Utils.Base64Encode(sb.ToString()));
_noticeHandler?.Enqueue(ResUI.BatchExportSubscriptionSuccessfully);
_noticeHandler?.SendMessage(ResUI.BatchExportSubscriptionSuccessfully);
}
}