From 0759be12235dba3e874969c9e06c6108fc4f2ecd Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Tue, 31 Dec 2024 15:32:31 +0800 Subject: [PATCH] Fix rule required https://github.com/2dust/v2rayN/issues/6378 --- .../ServiceLib/ViewModels/RoutingRuleDetailsViewModel.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/v2rayN/ServiceLib/ViewModels/RoutingRuleDetailsViewModel.cs b/v2rayN/ServiceLib/ViewModels/RoutingRuleDetailsViewModel.cs index ec02b941..a17ac19c 100644 --- a/v2rayN/ServiceLib/ViewModels/RoutingRuleDetailsViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/RoutingRuleDetailsViewModel.cs @@ -74,15 +74,16 @@ namespace ServiceLib.ViewModels SelectedSource.Protocol = ProtocolItems?.ToList(); SelectedSource.InboundTag = InboundTagItems?.ToList(); - bool hasRule = SelectedSource.Domain?.Count > 0 + var hasRule = SelectedSource.Domain?.Count > 0 || SelectedSource.Ip?.Count > 0 || SelectedSource.Protocol?.Count > 0 || SelectedSource.Process?.Count > 0 - || Utils.IsNotEmpty(SelectedSource.Port); + || Utils.IsNotEmpty(SelectedSource.Port) + || Utils.IsNotEmpty(SelectedSource.Network); if (!hasRule) { - NoticeHandler.Instance.Enqueue(string.Format(ResUI.RoutingRuleDetailRequiredTips, "Port/Protocol/Domain/IP/Process")); + NoticeHandler.Instance.Enqueue(string.Format(ResUI.RoutingRuleDetailRequiredTips, "Network/Port/Protocol/Domain/IP/Process")); return; } //NoticeHandler.Instance.Enqueue(ResUI.OperationSuccess);