From 326b40300fc3e335393cc8ed2af1a36d3f01178a Mon Sep 17 00:00:00 2001 From: plebeius Date: Fri, 27 Feb 2026 14:54:11 +0800 Subject: [PATCH] fix(reply-quote-preview): only scroll to reply when on thread page --- src/components/reply-quote-preview/reply-quote-preview.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/reply-quote-preview/reply-quote-preview.tsx b/src/components/reply-quote-preview/reply-quote-preview.tsx index ea7df6bb..6da6ca5f 100644 --- a/src/components/reply-quote-preview/reply-quote-preview.tsx +++ b/src/components/reply-quote-preview/reply-quote-preview.tsx @@ -126,6 +126,8 @@ const DesktopQuotePreview = ({ backlinkReply, quotelinkReply, isBacklinkReply, i const navigate = useNavigate(); const location = useLocation(); + const isOnThreadPage = location.pathname.includes('/thread/'); + const handleClick = (e: React.MouseEvent, cid: string | undefined, subplebbitAddress: string | undefined, isOpQuote = false) => { e.preventDefault(); if (cid && subplebbitAddress) { @@ -139,7 +141,7 @@ const DesktopQuotePreview = ({ backlinkReply, quotelinkReply, isBacklinkReply, i } return; } - if (scrollToReplyOnPage(cid)) return; + if (isOnThreadPage && scrollToReplyOnPage(cid)) return; navigate(threadRoute); } }; @@ -246,6 +248,7 @@ const MobileQuotePreview = ({ backlinkReply, quotelinkReply, isBacklinkReply, is const navigate = useNavigate(); const location = useLocation(); + const isOnThreadPage = location.pathname.includes('/thread/'); const handleClick = (e: React.MouseEvent, cid: string | undefined, subplebbitAddress: string | undefined, isOpQuote = false) => { e.preventDefault(); @@ -260,7 +263,7 @@ const MobileQuotePreview = ({ backlinkReply, quotelinkReply, isBacklinkReply, is } return; } - if (scrollToReplyOnPage(cid)) return; + if (isOnThreadPage && scrollToReplyOnPage(cid)) return; navigate(threadRoute); } };