Skip to content

Commit cc33c41

Browse files
committed
Drop SSR-unsafe sanitizeActionUrl and dedupe sanitizer
1 parent 883e471 commit cc33c41

1 file changed

Lines changed: 0 additions & 18 deletions

File tree

apps/webapp/app/components/navigation/NotificationCard.tsx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,6 @@ import { useLayoutEffect, useRef, useState } from "react";
33
import ReactMarkdown from "react-markdown";
44
import { cn } from "~/utils/cn";
55

6-
function sanitizeActionUrl(url?: string): string | undefined {
7-
if (!url) return undefined;
8-
const trimmed = url.trim();
9-
if (!trimmed) return undefined;
10-
11-
try {
12-
const parsed = new URL(trimmed, window.location.origin);
13-
if (parsed.protocol === "http:" || parsed.protocol === "https:") {
14-
return parsed.toString();
15-
}
16-
} catch {
17-
return undefined;
18-
}
19-
20-
return undefined;
21-
}
22-
236
export function NotificationCard({
247
title,
258
description,
@@ -40,7 +23,6 @@ export function NotificationCard({
4023
const [isExpanded, setIsExpanded] = useState(false);
4124
const [isOverflowing, setIsOverflowing] = useState(false);
4225
const descriptionRef = useRef<HTMLDivElement>(null);
43-
const safeActionUrl = sanitizeActionUrl(actionUrl);
4426

4527
useLayoutEffect(() => {
4628
const el = descriptionRef.current;

0 commit comments

Comments
 (0)