fix(quotes): scope post-number lookup by subplebbit, OP quote always navigates to thread

- numberToCid scoped by subplebbit address to fix wrong preview in /all/
- OP quote click navigates to thread page instead of highlighting card
This commit is contained in:
plebeius
2026-02-26 15:08:33 +08:00
parent c8824eb5d5
commit 216073aee3
9 changed files with 55 additions and 29 deletions
@@ -131,8 +131,12 @@ const DesktopQuotePreview = ({ backlinkReply, quotelinkReply, isBacklinkReply, i
if (cid && subplebbitAddress) {
const boardPath = getBoardPath(subplebbitAddress, directories);
const threadRoute = `/${boardPath}/thread/${cid}`;
if (isOpQuote && location.pathname === threadRoute) {
scrollToThreadCardTop(cid);
if (isOpQuote) {
if (location.pathname === threadRoute) {
scrollToThreadCardTop(cid);
} else {
navigate(threadRoute);
}
return;
}
if (scrollToReplyOnPage(cid)) return;
@@ -248,8 +252,12 @@ const MobileQuotePreview = ({ backlinkReply, quotelinkReply, isBacklinkReply, is
if (cid && subplebbitAddress) {
const boardPath = getBoardPath(subplebbitAddress, directories);
const threadRoute = `/${boardPath}/thread/${cid}`;
if (isOpQuote && location.pathname === threadRoute) {
scrollToThreadCardTop(cid);
if (isOpQuote) {
if (location.pathname === threadRoute) {
scrollToThreadCardTop(cid);
} else {
navigate(threadRoute);
}
return;
}
if (scrollToReplyOnPage(cid)) return;