diff --git a/components/drops/view/part/DropPartMarkdown.tsx b/components/drops/view/part/DropPartMarkdown.tsx index 76499e310b..c85017f7ec 100644 --- a/components/drops/view/part/DropPartMarkdown.tsx +++ b/components/drops/view/part/DropPartMarkdown.tsx @@ -216,7 +216,6 @@ export interface DropPartMarkdownProps { readonly onQuoteClick: (drop: ApiDrop) => void; readonly textSize?: "sm" | "md"; readonly currentDropId?: string; - readonly currentSerialNo?: number; } function DropPartMarkdown({ @@ -226,7 +225,6 @@ function DropPartMarkdown({ onQuoteClick, textSize, currentDropId, - currentSerialNo, }: DropPartMarkdownProps) { const isMobile = useIsMobileScreen(); const { emojiMap, findNativeEmoji } = useEmoji(); @@ -245,9 +243,8 @@ function DropPartMarkdown({ createLinkRenderer({ onQuoteClick, currentDropId, - currentSerialNo, }), - [onQuoteClick, currentDropId, currentSerialNo] + [onQuoteClick, currentDropId] ); const { customRenderer, renderParagraph, processContent } = useMemo( diff --git a/components/drops/view/part/DropPartMarkdownWithPropLogger.tsx b/components/drops/view/part/DropPartMarkdownWithPropLogger.tsx index 14033ccc79..d6129a24d9 100644 --- a/components/drops/view/part/DropPartMarkdownWithPropLogger.tsx +++ b/components/drops/view/part/DropPartMarkdownWithPropLogger.tsx @@ -23,7 +23,6 @@ function areEqual( "partContent", "textSize", "currentDropId", - "currentSerialNo", ]; for (const key of propsToCheck) { diff --git a/components/drops/view/part/dropPartMarkdown/handlers/seize.tsx b/components/drops/view/part/dropPartMarkdown/handlers/seize.tsx index e050b3cccb..80be3f265f 100644 --- a/components/drops/view/part/dropPartMarkdown/handlers/seize.tsx +++ b/components/drops/view/part/dropPartMarkdown/handlers/seize.tsx @@ -17,7 +17,6 @@ import { renderSeizeQuote } from "../renderers"; interface CreateSeizeHandlersConfig { readonly onQuoteClick: (drop: ApiDrop) => void; readonly currentDropId?: string; - readonly currentSerialNo?: number; } const ensureSeizeQuote = (href: string): SeizeQuoteLinkInfo => { @@ -30,19 +29,11 @@ const ensureSeizeQuote = (href: string): SeizeQuoteLinkInfo => { }; const createSeizeQuoteHandler = ( - onQuoteClick: (drop: ApiDrop) => void, - currentSerialNo?: number + onQuoteClick: (drop: ApiDrop) => void ): LinkHandler => ({ match: (href) => Boolean(parseSeizeQuoteLink(href)), render: (href) => { - const quoteInfo = ensureSeizeQuote(href); - - // Prevent infinite recursion when a drop references itself by serialNo - if (currentSerialNo && quoteInfo.serialNo && Number.parseInt(quoteInfo.serialNo, 10) === currentSerialNo) { - throw new Error("Seize quote link matches current drop"); - } - - const content = renderSeizeQuote(quoteInfo, onQuoteClick, href); + const content = renderSeizeQuote(ensureSeizeQuote(href), onQuoteClick, href); if (!content) { throw new Error("Unable to render seize quote link"); } @@ -135,9 +126,8 @@ const createSeizeDropHandler = (currentDropId?: string): LinkHandler => export const createSeizeHandlers = ({ onQuoteClick, currentDropId, - currentSerialNo, }: CreateSeizeHandlersConfig): LinkHandler[] => [ - createSeizeQuoteHandler(onQuoteClick, currentSerialNo), + createSeizeQuoteHandler(onQuoteClick), createSeizeGroupHandler(), createSeizeWaveHandler(), createSeizeDropHandler(currentDropId), diff --git a/components/drops/view/part/dropPartMarkdown/linkHandlers.tsx b/components/drops/view/part/dropPartMarkdown/linkHandlers.tsx index 8b32caf6b8..0253158984 100644 --- a/components/drops/view/part/dropPartMarkdown/linkHandlers.tsx +++ b/components/drops/view/part/dropPartMarkdown/linkHandlers.tsx @@ -25,7 +25,6 @@ import { interface LinkRendererConfig { readonly onQuoteClick: (drop: ApiDrop) => void; readonly currentDropId?: string; - readonly currentSerialNo?: number; } interface LinkRenderer { @@ -58,9 +57,8 @@ const findMatch = ( export const createLinkRenderer = ({ onQuoteClick, currentDropId, - currentSerialNo, }: LinkRendererConfig): LinkRenderer => { - const seizeHandlers = createSeizeHandlers({ onQuoteClick, currentDropId, currentSerialNo }); + const seizeHandlers = createSeizeHandlers({ onQuoteClick, currentDropId }); const handlers = createLinkHandlers(); const renderImage: LinkRenderer["renderImage"] = ({ src }) => { diff --git a/components/waves/drops/WaveDropPartContentMarkdown.tsx b/components/waves/drops/WaveDropPartContentMarkdown.tsx index 4843ea1607..3af3ed54ac 100644 --- a/components/waves/drops/WaveDropPartContentMarkdown.tsx +++ b/components/waves/drops/WaveDropPartContentMarkdown.tsx @@ -65,7 +65,6 @@ const WaveDropPartContentMarkdown: React.FC< partContent={part.content} onQuoteClick={onQuoteClick} currentDropId={drop?.id} - currentSerialNo={drop?.serial_no} /> {drop?.updated_at && drop.updated_at !== drop.created_at && (
diff --git a/components/waves/drops/WaveDropQuote.tsx b/components/waves/drops/WaveDropQuote.tsx index 9d98ee1c89..fdcd903b0f 100644 --- a/components/waves/drops/WaveDropQuote.tsx +++ b/components/waves/drops/WaveDropQuote.tsx @@ -157,7 +157,6 @@ const WaveDropQuote: React.FC = ({ textSize="sm" onQuoteClick={onQuoteClick} currentDropId={drop?.id} - currentSerialNo={drop?.serial_no} />