diff --git a/public/app/features/alerting/unified/components/rule-editor/AlertRuleForm.tsx b/public/app/features/alerting/unified/components/rule-editor/AlertRuleForm.tsx index 1c9969cc672..50b7390e049 100644 --- a/public/app/features/alerting/unified/components/rule-editor/AlertRuleForm.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/AlertRuleForm.tsx @@ -112,7 +112,7 @@ export const AlertRuleForm = ({ existing, prefill }: Props) => { const ruleType = translateRouteParamToRuleType(routeParams.type); const uidFromParams = routeParams.id; - const returnTo = String(queryParams['returnTo']) ?? '/alerting/list'; + const returnTo = !queryParams['returnTo'] ? '/alerting/list' : String(queryParams['returnTo']); const [showDeleteModal, setShowDeleteModal] = useState(false); const defaultValues: RuleFormValues = useMemo(() => {