From 5877b318799fc9f8bbc3e25679deb9f50d86d3e0 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Sun, 11 Oct 2026 17:28:20 +0200 Subject: [PATCH] fix: hide forward in filter rules when the server allows no redirects #1208 --- components/filters/filter-rule-modal.tsx | 10 +++++++++- components/settings/filter-settings.tsx | 8 ++++++++ locales/en/common.json | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/components/filters/filter-rule-modal.tsx b/components/filters/filter-rule-modal.tsx index 3fca0201f..090d5e19c 100644 --- a/components/filters/filter-rule-modal.tsx +++ b/components/filters/filter-rule-modal.tsx @@ -224,6 +224,9 @@ export function FilterRuleModal({ const otherForwards = forwardsBefore + (ruleStops({ actions, stopProcessing }) ? 0 : forwardsAfter); const forwardLimit = typeof maxRedirects === "number" && maxRedirects > 0 ? maxRedirects : null; const forwardOverLimit = forwardLimit !== null && forwardCount + otherForwards > forwardLimit; + // A limit of 0: the server runs no redirect at all, as the out of office + // card also takes it. A forward the rule already has stays, to be removed. + const forwardUnavailable = maxRedirects === 0; // While editing, condition.value is always the raw string typed into the // input (commas not yet split). Convert to array form here on save so a @@ -615,7 +618,7 @@ export function FilterRuleModal({ className={selectClass} aria-label={t("actions")} > - {ALL_ACTION_TYPES.map((a) => ( + {ALL_ACTION_TYPES.filter((a) => !(forwardUnavailable && a === "forward" && action.type !== "forward")).map((a) => (