diff --git a/packages/web/src/components/DashboardNotificationButton.tsx b/packages/web/src/components/DashboardNotificationButton.tsx index a3d897386..efc28ea23 100644 --- a/packages/web/src/components/DashboardNotificationButton.tsx +++ b/packages/web/src/components/DashboardNotificationButton.tsx @@ -59,16 +59,29 @@ function getSubjectPR(notification: DashboardNotificationRecord): Record - typeof action.url === "string" && action.url.trim().length > 0, - ) + .map((action) => { + const sanitizedUrl = sanitizeExternalUrl( + typeof action.url === "string" ? action.url.trim() : null, + ); + return sanitizedUrl ? { label: action.label, url: sanitizedUrl } : null; + }) + .filter((action): action is { label: string; url: string } => action !== null) .filter((action) => !shouldHideRedundantAction(action, { prUrl, reviewUrl })); return (